Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying space separated parameters

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

I have a string :
values = "10BaseT,100BaseTX,Auto"

I need the result to look:
10BaseT 100BaseTX Auto

How would I do it?

Long live king Moshiach !
 
Code:
BEGIN {
  values = "10BaseT,100BaseTX,Auto"
  gsub( /,/, " ", values )
  print values
}
 
Thanks,

What I actualy meant is that I do not know how many strings I can get between the "".
All I want is to display just ALL
strings between the "" ,space separated.
Thanks

Long live king Moshiach !
 
echo "$values" | sed 's!,! !g'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Another way:

#!/bin/ksh

values="10BaseT,100BaseTX,Auto"

set $(IFS=","; echo $values)
echo $*

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top