|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have few AIX 5.3 boxes where following is the issue. I have a variable whose value is a very huge string ...(5000+ characters) Code:
CMD_ARGS="/global/site/vendor/WAS/WebSphere6/AppServer/java/bin/java -Dcom.ibm.ws.client.installedConnectors=/global/site/vendor/WAS/WebSphere6/AppServer/profiles/dmgr/installedConnectors -Dcom.ibm.CORBA.ConfigURL......................................................................................:/global/site/vendor/WAS/WebSphere6/AppServer/lib/j2ee.jar com.ncode.DMIServer.DMIMain" Now i want to capture everything except $1 i.e in above example... "-Dcom" onwards everything.... How do i do this ? Regards Abhi |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
It means,you want only the following from CMD_ARGS variable. /global/site/vendor/WAS/WebSphere6/AppServer/java/bin/java If so,you try the following command. Code:
CMD_ARGS="/global/site/vendor/WAS/WebSphere6/AppServer/java/bin/java -Dcom.ibm.ws.client.installedConnectors=/global/site/vendor/WAS/WebSphere6/AppServer/profiles/dmgr/installedConnectors -Dcom.ibm.CORBA.ConfigURL......................................................................................:/global/site/vendor/WAS/WebSphere6/AppServer/lib/j2ee.jar com.ncode.DMIServer.DMIMain" echo $CMD_ARGS | cut -d ' ' -f 1 #It will print the $1 as I explained above |
|
#3
|
|||
|
|||
|
probably i miswrote...
i do not want $1.... i want rest of it... -Dcom.... onwards everything.... Regards Abhi |
|
#4
|
|||
|
|||
|
Based on the previous suggestion, you could try: Code:
echo $CMD_ARGS | cut -d ' ' -f 2- |
|
#5
|
|||
|
|||
|
you could also use read Code:
echo $CMD_ARGS | read FOO WHATYOUWANT Code:
echo $WHATYOUWANT -Dcom.ibm.ws.client.installedConnectors=/global/site/vendor/WAS/WebSphere6/AppServer/profiles/dmgr/installedConnectors -Dcom.ibm.CORBA.ConfigUR |
|
#6
|
|||
|
|||
|
Quote:
Code:
typeset content="" echo "word1 word2 word3 word4" | read . . content . print - "$content" But this sounds like a problem to me: Quote:
I hope this helps. bakunin |
|
#7
|
|||
|
|||
|
My problem is i am unable to test this on any of my boxes as the string is so huge... i tried few other options and all of them work but the string i used was smaller as compared to one i am referring to. you guys can try following options: Code:
1> echo $CMD_ARGS |nawk '{$1=" ";sub ("^ ","");print}'
2> echo $CMD_ARGS |cut -d ' ' -f 2-
3> echo $CMD_ARGS |nawk '{print substr($0,index($0," ")+1,length($0))}'i can't even paste that string here as it would look very weird....i m badly stuck... by the way,i could not understand 'read' concept in above posts....can you guys explain a bit more ? (or rather paste me the code :P ) Last edited by ak835; 03-11-2010 at 10:46 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get first column from a huge string ..!! | ak835 | Shell Programming and Scripting | 15 | 01-21-2010 01:21 PM |
| Spilt the line into two.... | ak835 | Shell Programming and Scripting | 21 | 11-17-2009 03:12 PM |
| Huge PI in vmstat | dkvent | Solaris | 9 | 08-14-2008 04:56 AM |
| How to spilt a file | deep_kol | Shell Programming and Scripting | 8 | 11-22-2007 02:12 AM |
| Spilt excel file in unix | Soumya Dash | Shell Programming and Scripting | 1 | 09-25-2006 02:56 AM |