sed and awk in shell script
i want to understand and use
sed and awk in the shell script |
uh huh. good for you. did you want to ask a question?
|
Well, it's not easy to express desire to have received advice to read man sed, man awk, info sed, info awk, man 7 regex.
|
Bash Beginner's Guide:
http://www.tldp.org/LDP/Bash-Beginners-Guide/ Advanced Bash Scripting Guide: http://www.tldp.org/LDP/abs/html/ Sed oneliners: http://www.student.northpark.edu/pem...d/sed1line.txt |
I'd like a Double Cheeseburger, extra large Coke and some fri... hey, can you put that in a meal?
|
Sure, get it here: http://www.brackenstore.com/images/b...eeseburger.jpg :D
|
Oh man I'm hungry...
|
ok ok guys, let's get back on track. wasn't the best start to a thread ever, but this is their thread, not yours...
|
Quote:
Code:
#!/bin/bash |
how to extract a particular word from a string in Shell scripting
hye,
since i'm not able to start a new thread, i'm raising my question here. I have a variable saying $remaining="/etc /var /sns /vol"(which is assigned at runtime) i want to check whether '/sns' is present in that. If it is, it should be removed and the string must be like $remaining="/etc /var /vol" Can I use awk command to do that. Plz help.Thnx in advance |
Awk by example: http://www-128.ibm.com/developerwork...ry/l-awk1.html
|
thanks.
but i want to extract from a string. not from a file.. so i dont think that 'awk' will work for this. can u suggest some other command in shell |
Maybe a bit anticlimactic, but my favorite sed and awk tutorials are at:
http://www.grymoire.com/Unix/ |
Quote:
nice script btw, this is a nice tuto / book / pdf: (not in english, sorry) http://www.bamboo.hc.edu.tw/linux/document/awk.pdf |
Re Perl, sure.
Normally all the Perl progs i write are self-sufficient, but there's no reason you can't call them from within a shell script. After all, you call them from the cmd line (bash) anyway ... |
All times are GMT -5. The time now is 04:53 PM. |