Help - Search - Members - Calendar
Full Version: help with script
Linuxhelp > Support > Programming in Linux
chaybird001
Hi,

I am very new to linux and I can't figure out why my script cannot run from a different file location. I think I am missing something in my script, but I am not sure. Here is what I have so far.

#!/bin/bash/home/cs2165/cs216523

while true
do
echo "$(date)" |tee -a mylog1
echo "meeting at"; date '+%H:%M'
sleep 5

done


I recently added home/cs2165/cs216523 because I thought that was need to run my script from that location.
Please help.
michaelk
#!/bin/bash tells the terminal what interpreter to use.

If the directory where mylog is located is not in your path environment then the script will not work. You can add a statement to change to the directory like
cd /location/of/mylog1 before the while. Be sure to use the actual path.
Javi12Alvares
I am also new at Linux maybe you can help me.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.