hi i am passing parameter to my shell script and getting very weird result .Below is this script-:
#!/bin/bash
# set the STRING variable
path=$1
echo password | sudo -S -l
sudo /usr/bin/su - abcd << EOF
cd $path
#write out current crontab
crontab -l > $2
#echo new cron into cron file
echo $3
#echo $3 >> $2
#install new cron file
#crontab mycron
EOF
Above works fine, it goes on specified path,and create backup file but when it goes to echo $3 gives wrong result (weird long string i can not show here).But it only gives that output if pass parameter as belw
./createNewCron.sh /u/siebel/abcd backing.txt "00 09 * * 1-5"
But when i pass string like below it works fine-:
./createNewCron.sh /u/siebel/abcd backing.txt "echo hello"
Can anyone explain me why? Thanks