# comment


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers # comment
# 1  
Old 01-07-2004
# 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 11:11 AM..
# 2  
Old 01-07-2004
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
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
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 12:14 PM..
# 5  
Old 01-07-2004
The 01 4 * * 2-6 line is failing because ends with 2.&1 instead of 2>&1
# 6  
Old 01-07-2004
mistype

I am sorry I miss typed it it does go 2>&
# 7  
Old 01-07-2004
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 Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add comment if not present

I have a file cat /root/file #import node1 #import node2 import node2 import node4 After sed/awk operation the file should be as follows cat /root/file #import node1 #import node2 #import node2 #import node4 (6 Replies)
Discussion started by: anil510
6 Replies

2. Shell Programming and Scripting

Help about comment verification

Hello, I have a file, in which line 40 is commented. It is basically a cron job, #05,35,50 * * * * /usr/local/scripts/my.sh how i can i verify the line 40 is commented, if not then give me message not commented, otherwise provide us message it is commented. (5 Replies)
Discussion started by: learnbash
5 Replies

3. Cybersecurity

get ssh key comment

Hey Guys, I have a server, and a technical user on it (only for reading logs). I set up openssh, and the user can login only with ssh key pair. Under this one technical user, there are a lots of public keys in the ~/.ssh/authorized_keys file. I would like to find out/log with which key the user... (3 Replies)
Discussion started by: lyynxxx
3 Replies

4. Shell Programming and Scripting

How can i comment out a section between two particular lines

I want to find out which files under /etc have the the following section: and then i would like to comment out the above section in all the files. Please help. (3 Replies)
Discussion started by: proactiveaditya
3 Replies

5. Shell Programming and Scripting

Comment entries in the file

Legends, Please help me out to come out of below situation. I have a file ABC.txt with the following entries. (example below. actual entries are more than 200 lines) PM3_fun PM4_fun FIMr_mrg ... (5 Replies)
Discussion started by: sdosanjh
5 Replies

6. UNIX for Dummies Questions & Answers

comment lines

Is there a command to put a comment (#) in a whole part of a shell script? (5 Replies)
Discussion started by: vero_81
5 Replies

7. UNIX for Dummies Questions & Answers

how to replace this text with comment

test compare shown] Replace this text with #test compare shown] (1 Reply)
Discussion started by: manoj.b
1 Replies

8. Shell Programming and Scripting

comment text in a file

Hello folks Hope all are fine, I have query need suggestion, if these lines two lines are already commeted no need to do anything, one more thing order of alpha, gama may be different. I have a two lines in a file data.txt %checksum alpha gama beta penta hexa I want to do... (8 Replies)
Discussion started by: learnbash
8 Replies

9. Shell Programming and Scripting

Pls comment on my script.

Hi guys, hope you scripting gurus here can help me out, the logic in my script somehow not working the way it should, this script part of a bigger backup script suppose to do some checking on the cluster prior to bringing up the package on MC/SG after backend cloning operation, this portion is... (3 Replies)
Discussion started by: sparcguy
3 Replies

10. Shell Programming and Scripting

How to copy and comment out

I need help with a script. Here's what I want to do. I have a file "upsrk.txt" which can be either under "/home/upsrk" OR "/home/oracle" On some systems file "upsrk.txt" may not exist, in that case I want to just exit out of the script. If the file is there, I want to check if I have the... (3 Replies)
Discussion started by: upsrk
3 Replies
Login or Register to Ask a Question