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
command line args 2 skooly5 UNIX for Dummies Questions & Answers 2 04-06-2008 10:36 PM
command line args skooly5 UNIX for Dummies Questions & Answers 2 04-06-2008 08:46 PM
display a process args list ermur Shell Programming and Scripting 3 07-17-2007 09:46 PM
Command line args enuenu High Level Programming 2 05-29-2007 01:19 AM
alias with args how to ... umen UNIX for Dummies Questions & Answers 4 12-28-2005 07:47 AM

Closed Thread
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
  #1 (permalink)  
Old 06-30-2003
Shaz Shaz is offline
Registered User
  
 

Join Date: May 2002
Posts: 23
Args to Array

Hello all,
I have a question. Please help me to populate an array with the arguments passing to a Shell scripts.

For example when I call "abc.sh a1 a2 a3" args (a1, a2, ...) recieved in an Array inside the abc.sh

arr[0] = a1
arr[1] = a2
and so on...


Thanks in advance,
  #2 (permalink)  
Old 06-30-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
In ksh:
set -A arr $*
  #3 (permalink)  
Old 06-30-2003
Shaz Shaz is offline
Registered User
  
 

Join Date: May 2002
Posts: 23
amazingly, for some reason my code like below
always resided all args into element 1 and 2 of the array...

set -A arr
arr=S*

but I've changed it to

ste -A arr $*

and it works just fine...


Thanks a lot...
Closed Thread

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 10:24 PM.


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