![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" | iBot | UNIX and Linux RSS News | 0 | 01-04-2008 12:00 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| grep to find content in between curly braces, "{" and "}," | keshav_rk | Shell Programming and Scripting | 4 | 08-09-2007 07:14 PM |
| grep/cat/more -- search in a txt file and display content from a specific "keyword" | I-1 | UNIX for Dummies Questions & Answers | 4 | 02-21-2007 01:57 AM |
| No utpmx entry: you must exec "login" from lowest level "shell" | peterpan | UNIX for Dummies Questions & Answers | 0 | 01-18-2006 01:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
grep "$1\.mylogs\.20" ?
Can any kind souls explain the above to me please?
In additional, the following line (within brackets) also muffles me, please enlighten me. ( awk '{print $2}' ) |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
grep "$1\.mylogs\.20"
Usually $1 is the first parameter passed to a shell script. Say, $1 is new2ss in this case. So the search string is "new2ss.mylogs.20" The \ is used to escape the character which appears just after the \ In the unix world, a . represents any character. So a /. would mean a . in its entirety. Your grep search pattern can be like this as well grep "$1.mylogs.20" |
|
#3
|
|||
|
|||
|
Thanks , Vino.
Any idea what does ' awk {print $2} ' do ? |
|
#4
|
||||
|
||||
|
Code:
[~]$ echo "Welcome to the unix forums" | awk '{ print $2 }'
to
For more info read the man pages of awk. Last edited by vino; 01-30-2006 at 08:15 AM. |
|
#5
|
|||
|
|||
|
Thank you, vino
|
|
#6
|
|||
|
|||
|
new2ss, please get some basic understanding about regular expression syntex. so that u wont get any problem in future.
these are not so difficult. |
|||
| Google The UNIX and Linux Forums |