Another approach for Shell Script

Hi

Currently we are using shell script to connect to  mainframes and to get a file then we will execute macro to populate values into xls . Now instead of shell script  we want to use another approach . Please provide me possible solutions.

Thanks,
lokesh
lokesh murariAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

simon3270Commented:
I assume your shell script is calling some program to get the file from the remote site (curl, wget, ftp?).

In that case you could use some other language (e.g. Python) to make the same call. That doesn't gain you much over a shell script.

Alternatively, there will probably be a Python module to perform the same task.  For example, the pycurl module will perform the same operations as the "curl" command, to allow you to retrieve a file. As a bonus the same module will do ftp, sftp and so on, if that's what you were doing.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skullnobrainsCommented:
maybe export and mount the directory the file resides in on the mainframe on your clients and access it seamlessly ?
might be a little easier to help if you describe your goal more precisely.
Murugesan NagarajanShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NTCommented:
I always prefer shell script including populating .xls file:
#!/bin/bash
OS=''`/bin/uname -s | /bin/awk -F"-" '{ print $1}'`''
export TARGET_HOSTNAME=CHANGE_RELATED_HOST
PING=''`/usr/bin/which ping`''
FTP=''`/usr/bin/which ftp 2>/dev/null`''
DOS2UNIX=''`/usr/bin/which dos2unix 2>/dev/null`''
if test "" != "$PING"
then
	if test "CYGWIN_NT" = "$OS"
	then
		$PING -n 1 $TARGET_HOSTNAME 2>/dev/null
	else
		$PING -c 1 $TARGET_HOSTNAME 2>/dev/null
	fi
	PING_RET=$?
	if test 0 -eq $PING_RET
	then
		if test "" != "$FTP"
		then
			$FTP -n TARGET_HOSTNAME <<EOD
USER userid password
CD /RequiredDirectory
BINARY
GET RequiredFile.txt
QUIT
EOD
			FTP_Ret=$?
			if test 0 -eq $FTP_Ret
			then
				if test -f RequiredFile.txt
				then
					/usr/bin/file RequiredFile.txt | /bin/egrep -w "CRLF" >/dev/null 2>&1
					Ret=$?
					if test 0 -eq $Ret
					then
						if test "" != "$DOS2UNIX"
						then
							echo $DOS2UNIX RequiredFile.txt
							$DOS2UNIX RequiredFile.txt
							/bin/sed "s/ /,/g;" RequiredFile.txt > RequiredOutput.xls
							Ret=$?
							if test 0 -eq $Ret
							then
								echo "Created following output file:"
								echo "RequiredOutput.xls"
							fi
						else
							echo "dos2unix No such file"
						fi
					fi
				fi
			fi
		else
			echo "ftp No such file.";
		fi
	fi
else
	echo "ping No such file.";
fi

Open in new window

Same thing can be handled at all OS using:
different types of programming( C / C++ / java / python / perl / power shell / ftp / sftp / curl / ... )
Murugesan NagarajanShell_script Automation /bin/bash /bin/bash.exe /bin/ksh /bin/mksh.exe AIX C C++ CYGWIN_NT HP-UX Linux MINGW32 MINGW64 SunOS Windows_NTCommented:
1. Provided related comments
2. Tested and resolved
3. Inactive for 14 days.
skullnobrainsCommented:
not objecting. too late anyway. but i strongly disagree with the closure :
- there is no confirmed "answer"
- the initial problem is not entirely identified so there is no way to assume any of our posts was even useful
- there is zero chances that this thread can be useful to anyone else

my recommendation : delete the question
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.