The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Variable for User Comment gseyforth Shell Programming and Scripting 2 03-09-2007 11:01 AM
how to comment multiple lines in unix balireddy_77 Shell Programming and Scripting 3 02-19-2007 04:16 AM
Comment faire une soustraction de date? Cecile UNIX for Dummies Questions & Answers 2 08-25-2006 06:38 AM
remove single-line comment Icy002 High Level Programming 3 04-09-2006 05:30 AM
Need to add a comment line in a text file orakhan Shell Programming and Scripting 2 09-22-2005 05:36 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-07-2004
Registered User
 

Join Date: Oct 2003
Location: Pratt,KS
Posts: 78
# comment

Hi guys and Gals AIX 5.1
If I had a # above several scripts would it comment out everything below it?
Like this

#
01 2 ** .....................................
02 31 .........................................
# this is a script
03 12 **..........................


Would everything below that first comment be commented out?

Last edited by rocker40; 01-07-2004 at 08:11 AM.
Forum Sponsor
  #2  
Old 01-07-2004
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Rocker40,

No, in shell scripting (sh, ksh, csh,...) placing one comment (#) does not comment all below it like <! does in html (where you have to 'turn it off' </! )

In some other languages it does work the same as in html - turn on comments and turn them off.
  #3  
Old 01-07-2004
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
If you want to achieve that effect, you could use an "exit" statement.

I somethimes put code below a final exit statement while I'm developing a script.
  #4  
Old 01-07-2004
Registered User
 

Join Date: Oct 2003
Location: Pratt,KS
Posts: 78
comment

I am using AIX 5.1
I commented out a line and the took it out.
The only thing I noticed was that # sitting by itself so it had me wondering.
I guess I edited it with {VI} What language would these crons be written in using the AIX 5.1 ?
here is the actual script.
#
01 1 * * 6 /rd/bin/backup.full >> /rd/tmp/cron.full.log 2>&1
#refresh test enviroment from online backups
01 4 * * 2-6 /rd/bin/restoretest.db >> /rd/tmp/testdbrefresh.log 2>&1


It is the 01 4 * * 2-6 line that hasn't been running.
I just saw your reply
Maybe it is in the command script itself that the problem is?

Last edited by rocker40; 01-07-2004 at 09:14 AM.
  #5  
Old 01-07-2004
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
The 01 4 * * 2-6 line is failing because ends with 2.&1 instead of 2>&1
  #6  
Old 01-07-2004
Registered User
 

Join Date: Oct 2003
Location: Pratt,KS
Posts: 78
mistype

I am sorry I miss typed it it does go 2>&
  #7  
Old 01-07-2004
Registered User
 

Join Date: Oct 2003
Location: Pratt,KS
Posts: 78
resolution!!

It seems that maybe I forgot to run to run this command {crontab root} after using VI in when editing the root file of crontabs.
Some advice to my friends out there.
When ever you edit a root file usually located in /var/spool/cron/crontabs
you must run {crontab root} to activate the script back into action.
Fortunatly I was able to recover the data
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0