![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parsing a string in a shell script | asutoshch | Shell Programming and Scripting | 19 | 05-26-2008 10:18 PM |
| question to build a shell script | vishalpatel03 | Shell Programming and Scripting | 5 | 12-12-2007 12:45 PM |
| shell script string extension | vbm | Shell Programming and Scripting | 4 | 11-10-2006 01:58 AM |
| Reversing and trim a String through SHELL script | DeepakXavier | Shell Programming and Scripting | 5 | 09-28-2005 10:25 AM |
| Shell script: Cut / (slash) character in string | ThuongTranVN | UNIX for Dummies Questions & Answers | 4 | 01-30-2001 12:35 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi Thank you.
It was printing the required result. Can you help me in assigning it to a variable. i tried PK_STR= echo 'PK="PK1 PK2 PK3"' | awk -F"\"" '{split($2,s," ") print "a."s[1]"=b."s[1]" and a."s[2] "=b."s[2] " and a."s[3] "=b."s[3]}' it is not working Thanks |
|
||||
|
Code:
PK_STR=`echo 'PK="PK1 PK2 PK3"' |
awk -F"\"" '{split($2,s," ")
print "a."s[1]"=b."s[1]" and a."s[2] "=b."s[2] " and a."s[3] "=b."s[3]}'`
or: Code:
PK_STR=$(echo 'PK="PK1 PK2 PK3"' |
awk -F"\"" '{split($2,s," ")
print "a."s[1]"=b."s[1]" and a."s[2] "=b."s[2] " and a."s[3] "=b."s[3]}')
Regards |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|