![]() |
|
|
|
|
|||||||
| 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 |
| how to modify a file using shell script | syamkp | Shell Programming and Scripting | 1 | 03-07-2008 09:16 AM |
| variables in shell | viko | Shell Programming and Scripting | 2 | 03-03-2008 08:09 PM |
| How to modify an existing pdf with unix shell commands | fandwick | UNIX for Advanced & Expert Users | 3 | 06-08-2007 07:28 AM |
| Using shell variables In awk | nortypig | Shell Programming and Scripting | 11 | 08-23-2006 09:48 PM |
| Is it possible in a shell script to modify itself ?? | sehgalniraj | Shell Programming and Scripting | 5 | 03-22-2005 09:21 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Modify shell variables with AWK
Dear Folks,
I have a command output something like: Quote:
Code:
PIN=`gsmctl -d /dev/ttyS0 pin sig | awk '/PIN0/ { print $2}'`
SIG=`gsmctl -d /dev/ttyS0 pin sig | awk '/SIG0/ { print $2}'`
Regards, |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
/PIN0/ { printf "PIN=%s\n", $2 }
/SIG0/ { printf "SIG=%s\n", $2 }
Code:
$ eval `gsmctl -d /dev/ttyS0 pin sig | awk -f awkfile` $ echo $PIN $SIG READY 31 |
|
#3
|
|||
|
|||
|
fpmurphy, thanks for your reply ;-)
I want to use only one script/file.. using awk -f I need at least two files, is there any solution to make this only with one script? perhaps using another way instead of awk? Thanks!! Regards, |
|
#4
|
|||
|
|||
|
Quote:
Code:
gsmctl -d /dev/ttyS0 pin s | xargs | read X PIN Y SIG echo $PIN echo $SIG |
|
#5
|
||||
|
||||
|
Quote:
Code:
set `gsmctl -d /dev/ttyS0 pin s |awk '{print $2}'`
echo $1 $2
|
||||
| Google The UNIX and Linux Forums |