![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove spaces btw | tjmannonline | UNIX for Dummies Questions & Answers | 7 | 05-26-2008 02:35 AM |
| Remove spaces from columns | jacks | Shell Programming and Scripting | 2 | 01-18-2008 10:08 AM |
| How to remove trailing spaces | mahek_bedi | UNIX for Dummies Questions & Answers | 2 | 08-10-2007 07:21 AM |
| Removing empty spaces and adding commas | jazz | High Level Programming | 4 | 11-13-2006 09:54 AM |
| how to remove spaces in a string using sed. | radhika | Shell Programming and Scripting | 4 | 06-02-2005 03:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hey guys,
I am very much new to shell scripts. So you ppl may feel that i am asking stupid question here. 1. I am using command line argument as an input variable. The user gets this value in his mail from client which has commas n spaces (Eg. 12,34,56,789) and the scripts input should not contain any commas, spaces dashes etc... So to Normalise it i hv used following thing sh 123.sh 12,34,56,789 #12,34,56,789 is jst an example of input i.e. command line argument. echo "$1" | perl -pi -e "s/,//g;" Now the problem is I want to take its output (i.e output of echo "$1" | perl -pi -e "s/,//g;" ) as input for next line of script. For this I tried following thing echo "$1" | perl -pi -e "s/,//g;" | $i But its not working... what do i do? |
|
||||
|
Hey Thanx for the quick reply
The line written by me in script (i.e echo "$1" | perl -pi -e "s/,//g;") even that is working... but what i want to do is, i want to take the output of this line in a variable... So that i can use it further.. Do u kno how do i do it? |
|
||||
|
var1=`echo $1 | tr "," " "`
If $1 = 1,2,3 Then var1 will contain 1 2 3. Thanks & Regards, Siba Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|