Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



The DNS Guys

25 Nameservers Worldwide

Host Monitoring & Auto Rollback

Smart Relay, SASL

OpenID Servers & XMPP

TSIG & Secondary DNS

Amazon Route53 GUI
 
Reply to this topicStart new topic
> help with script
chaybird001
post Apr 1 2012, 01:22 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 27-March 12
Member No.: 17,510



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.
Go to the top of the page
 
+Quote Post
michaelk
post Apr 1 2012, 04:33 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,684
Joined: 23-January 03
Member No.: 360



#!/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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd September 2014 - 09:21 AM