![]() |
|
|
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 |
| How to replace a specific word in specific column? | ./hari.sh | Shell Programming and Scripting | 6 | 03-07-2009 09:33 AM |
| how to display specific lines of a specific file | raidkridley | UNIX for Dummies Questions & Answers | 2 | 10-15-2008 03:46 PM |
| Copying specific files from remote m/c to specific folders | jhoomsharabi | Shell Programming and Scripting | 0 | 06-12-2008 08:31 AM |
| Assign variables with cut | douknownam | Shell Programming and Scripting | 2 | 09-27-2004 10:18 AM |
| Assign a process to specific CPU | tforveil | UNIX for Dummies Questions & Answers | 8 | 12-23-2003 05:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
How to assign the specific value
Hi Everyone,
How to assign the specific value which return from database? here is the return value from database --> (return status = 0) 0 <----- this I only need to get the "0" .. assign to another declare variable. hope someone will help me.. Please thank you.. |
|
||||
|
Hi,
For example, the return value from database is data->> (return status = 0) 0 but i just wan to get "0" to assign into another new declaration. if i do like this : rc=$data rc will still get (return status = 0) 0 i just wan to get the specific "0", remove the others. Thank you |
|
||||
|
Not sure if I understand totally but I think you want the '0' after the words "return status = "? Maybe this will give you some direction...
Assuming data="(return status = 0)" rc=`echo $data|cut -d"=" -f2|cut -c1-2` echo data=$data echo $rc ---- output: data=(return status = 0) 0 |
|
||||
|
Thank you giannicello... the way u teach me is working fine... but i did change a bit,
Thank you so much.... The command show below is the way i changed... coz some return value is -1 or -2 or 0, and i have to get the number value is outside the branket... Thank you so much.. rc=`echo $result|cut -d")" -f2|cut -c1-3|cut -d" " -f2` rc=-1 done... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|