Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-13-2003, 03:04 AM   #1
Registered: Mar 2003
Posts: 76

Rep: Reputation: 15
some bash shell scripting

hey guys, im trying to write a shell script for bash. here's the basic idea


while [ $count -gt 0 ]
let input=$#-count+1
echo $input
let count=count-1

what i want it to do is just list all the paramaters, ie if i type in

command x y z

i want it to return x y z.

however, wut it does here is return the value of input. in this case i would see 1 2 3. does anyone kno how i can make $input into a positional variable??
Old 09-13-2003, 08:50 AM   #2
Senior Member
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
Would be easier to do...
for arg in $@
  echo $arg
Old 10-22-2003, 01:10 PM   #3
LQ Newbie
Registered: Oct 2003
Posts: 6

Rep: Reputation: 0
cant you just do

echo $*



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash shell scripting Sco Linux - Newbie 1 11-09-2004 11:58 AM
Bash shell scripting question mehesque Programming 2 07-15-2004 10:54 AM
Help with I/O on bash shell scripting Dave6383 Programming 1 06-03-2004 05:24 PM
Bash Shell Scripting Help Tangerine Programming 6 05-06-2003 02:10 PM
BASH Shell scripting help ewarmour Linux - General 8 05-25-2002 07:10 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration