The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
redirecting variable content to a file! lloowen Shell Programming and Scripting 2 05-24-2008 05:30 PM
Content of Content of a variable! jaduks Shell Programming and Scripting 2 08-27-2007 01:40 AM
How to replace a variable content josephwong Shell Programming and Scripting 4 06-26-2006 12:18 AM
Point and Array Convert Problem zhshqzyc High Level Programming 0 02-25-2006 09:28 PM
Compare the content of a variable with a string robdai UNIX for Dummies Questions & Answers 2 11-01-2005 07:29 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-03-2008
Alalush Alalush is offline
Registered User
  
 

Join Date: Jul 2008
Location: Israel
Posts: 21
convert variable content to array

Hi All,

I have a variable in a shell script which holds let say n paarmeteres with space separate them :

$var = par1 par2 par3 par4 parn;
so if I print this variable this is what I'll see:
par1 par2 par3 par4 parn

I need to insert each parameter to an array , so I can go over on each of this parameters with a loop command.
Actually it doesn't have to be in an array , I just need to find away to go over on each parameter in this variable and preform some operation on it.

Any suggestions ?

Thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0