10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
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
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
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
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
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
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
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
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
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