Need to add a comment line in a text file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to add a comment line in a text file
# 1  
Old 09-22-2005
Bug Need to add a comment line in a text file

Hi I need to add a comment line at the begining of a text file. The scenario is given below.

1. The number of servers that needs to be updated is around 80

2. The location of the text file in all the servers are the same including the file name.

3. The comment has to be added at the very begining of the text file

4. I have remote shell (remsh) access to all these servers.


Please let me know how can this be done


Regards

Asad
# 2  
Old 09-22-2005
No Updates Smilie
# 3  
Old 09-22-2005
Please review the rules. Do not bump up questions if they're not answered within your expected timeframe.

You only posted the initial request 4 hours before your follow up. If you require responses that quickly, maybe you should hire a consultant to help you do your job.

Thanks
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to comment a specific line of a file in Solaris 10?

Hi Folks, sed -i '3s/^/#/' abc.txt is commenting the line number 3 in LINUX Not Working in Solaris 10 or higher sed -i sed -i '3s/^/#/' abc.txt sed: illegal option -- i i have a file as below cat abc.txt bc vdv shhsd cdc skdk Please advise (15 Replies)
Discussion started by: abhaydas
15 Replies

2. Shell Programming and Scripting

Add comment on last line if found match

Hi All, totally new on it , normally use it for just 1 line. i'm looking for help. i'm have 2 file. file 1 : -------------------------------------------------- c12 c1 c3 -------------------------------------------------- file 2: other content ... (10 Replies)
Discussion started by: kttan
10 Replies

3. Shell Programming and Scripting

How to comment a specific line of a file?

Hi, I need to comment out (insert # in the front of a line) a line that has entry Defaults requiretty using command-line as I need to do this on hundreds of servers. From Defaults requiretty To #Defaults requiretty I tried something like below but no luck: Please advise,... (3 Replies)
Discussion started by: prvnrk
3 Replies

4. Shell Programming and Scripting

how to add text into the last line of text file

I need help with insert text to the last line of text file with echo command I know can do something like echo "i4\n$logtext\n.\nwq" | ex -s $file can insert to first line, but how can i change this code in order to insert to the last line of text file? please help, thank you :( (2 Replies)
Discussion started by: gavin_L
2 Replies

5. Shell Programming and Scripting

add line and remove comment in some script

Hi, i need some help. i am not sure about my idea. I have a script directory under my home directory,which has a lot of scripts in it. These are some names of the scripts in /axxhome/prdv/script aly300.sh axt300.sh arv300.sh clp300.sh ctth300.sh aly400.sh axt400.sh arv400.sh... (6 Replies)
Discussion started by: debu000
6 Replies

6. Shell Programming and Scripting

sed add after line x new text from file

I've been playing with sed, trying to get it to insert the contents of somefile.txt after line 13 on anotherfile.txt. I tried searching for a line with regex and attempting to insert something on the next line with: find ./anotherfile.txt -type f -exec sed -i -e '/^dog/cat/' {} \; but it... (2 Replies)
Discussion started by: unclecameron
2 Replies

7. Shell Programming and Scripting

Add ; to every line in text file

Please help to add ; to every line in a text file i Have tired sed 's/$/ ; /g' > /tmp/drop_tables.sql but not working :( Thanks (2 Replies)
Discussion started by: bluebird5m
2 Replies

8. UNIX for Dummies Questions & Answers

how to replace a text of line with a comment line

I want to replace this line : "test compare visible] true" and make it "#test compare visible] true". How can I do it ? And it should be checked in many sub folder files also. (6 Replies)
Discussion started by: manoj.b
6 Replies

9. 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

10. Shell Programming and Scripting

Add text to file at a certain line

I am trying to add a line of text just before the last line in a file. For example, if the last line of a file is "exit 0", I need to add a line of text just before that. Any ideas how I might do that? Thanks (5 Replies)
Discussion started by: TheCrunge
5 Replies
Login or Register to Ask a Question