Feeds:
Posts
Comments

Archive for the ‘Shell Programming’ Category

Sometimes you want to execute script on your another server automatically without rsh. What you usually do is telnet to that server and execute the script. But how to make it automatic ?
You can use the tricky method bellow
Asume your server target is 198.10.10.2 and you want to execute
/home/hnawri/alarm.sh
(sleep 1
echo username
sleep 1
echo password
sleep 1
echo “/home/hnawri/alarm.sh”
sleep [...]

Read Full Post »

FTP from shell

Maybe it can help you to do automatic ftp from your shell script
ftp -in IP_ADDRESS << EOF
user username password
prompt off
cd $destination_dir
lcd $local_dir
put $files
bye
EOF

Read Full Post »

If you want to get data from Oracle using shell, you can use this script

$SQLPLUS -s $ORACLE_USER/$ORACLE_PASSWD@$ORACLE_SID << EOF >> $FILE
@$SQL_SCRIPT
exit
EOF
In order to avoid feedback and title heading, you may add

set heading off
set feedback off
on your $SQL_SCRIPT

Read Full Post »