Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 07-23-2004, 09:35 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 12

Rep: Reputation: 0
bash scripting - referring to external arguments into loops

hallo everyone!

Here is a simplified version of my problem:

I have a script and would like it to handle several arguments: a1,a2,a3,a4..................
I usually indicate them with $1, $2, $3.......
i want it to print on screen a2,a3.........

for (( i = 2 ; i < $# ; i++ ))
echo ????????????????

if I write $i it does not work because it prints "i" values and not a1,a2..........
i tried various things but none worked

$[$i] ; $("$"$i"") ; $ $i ; $"$i"

I think there must be an easy answer to write external arguments in a loop but I couldn't find it.

Can anyone help?

Thanks a lot

PS Does anyone know the bash scripting command which plays the role of the BREAK command in c++ ??
Old 07-23-2004, 11:17 AM   #2
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.
Old 07-23-2004, 12:24 PM   #3
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Closed - as per above.

Closed Thread

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash, LS, For loops, and whitespaces in directories jhrbek Programming 27 09-22-2010 05:17 AM
bash scripting and loops phoeniks Programming 5 01-24-2005 04:00 PM
[bash-scripting]functions + arguments hylke Programming 14 10-05-2004 01:48 AM
Indicating external argument into loops in SCRIPTs linsson Programming 7 07-28-2004 12:55 PM
bash - while + until loops grouping? trees Linux - General 2 02-19-2004 02:29 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:29 AM.

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