Wobbs_pei
asked on
shell unix programming
I am not a unix anything but need to figure out what this script does.
Does this script create a file ( file name ) what the contents of the file would be and also where this script places the file and also if each file overwrites a previous one.
I would love for someone to step me through each line.
#
if [ $# -ne 2 ] ; then
echo Usage: $0 'first|second|third|last' code
exit 1
fi
#
#
case $1 in
first | FIRST )
PHONE="9,16053398788"
;;
second | SECOND )
PHONE="9,16054927763"
;;
third | THIRD )
PHONE="9,16058657899"
;;
last | LAST )
PHONE="9,16053339843"
;;
* )
echo Unknown number.
exit 2
;;
esac
#
#
#
tempfile=$$.page
cd /usr/tmp
echo $PHONE $2 > $tempfile
sftp dev@omaha09 <<!
cd /usr/local/tocage
put $tempfile
quit
!
/usr/bin/rm $tempfile
Does this script create a file ( file name ) what the contents of the file would be and also where this script places the file and also if each file overwrites a previous one.
I would love for someone to step me through each line.
#
if [ $# -ne 2 ] ; then
echo Usage: $0 'first|second|third|last' code
exit 1
fi
#
#
case $1 in
first | FIRST )
PHONE="9,16053398788"
;;
second | SECOND )
PHONE="9,16054927763"
;;
third | THIRD )
PHONE="9,16058657899"
;;
last | LAST )
PHONE="9,16053339843"
;;
* )
echo Unknown number.
exit 2
;;
esac
#
#
#
tempfile=$$.page
cd /usr/tmp
echo $PHONE $2 > $tempfile
sftp dev@omaha09 <<!
cd /usr/local/tocage
put $tempfile
quit
!
/usr/bin/rm $tempfile
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The file that would be uploaded to the remote server would have one line in it that would look something like this:
9,16053398788 xxx
(where "xxx" is the code, or the 2nd argument to the script. The author however does not put any validation in the script to make sure the code field is accurate)
9,16053398788 xxx
(where "xxx" is the code, or the 2nd argument to the script. The author however does not put any validation in the script to make sure the code field is accurate)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This has nothing to do with PowerShell, why is this in the PowerShell zone?
ASKER
Thank you both
#
if [ $# -ne 2 ] ; then
echo Usage: $0 'first|second|third|last' code
exit 1
fi
#