LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Closed Thread
 
Search this Thread
Old 07-23-2004, 09:35 AM   #1
linsson
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++ ))
do
echo ????????????????
done

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
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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.

http://www.linuxquestions.org/rules.php

http://www.linuxquestions.org/questi...hreadid=208713
 
Old 07-23-2004, 12:24 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
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


All times are GMT -5. The time now is 06:18 AM.

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