Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-20-2009, 03:52 PM   #1
LQ Newbie
Registered: Apr 2004
Posts: 6

Rep: Reputation: 0
Bash command line arguments


I am writing a simple bash script that reads bunch of command line arguments and calls couple of other program passing those options.

When someone invokes, arg1 arg2 arg3 arg4 arg5

program1 arg1 arg2 arg4
program2 arg1 arg3 arg3 arg5

How can I do this? Thanks.
Old 03-20-2009, 03:56 PM   #2
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 59
Check for "Positional parameters" on this page.


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
Command line arguments bioinformatics_guy Linux - Newbie 2 02-12-2009 08:26 AM
need some help regarding command line arguments kristam269 Linux - General 1 01-23-2007 10:40 AM
command line arguments nickraj Programming 6 09-11-2006 02:01 PM
Command line arguments?? almagerenia Linux - Newbie 1 09-08-2006 05:05 AM
command line arguments containing ( Lotharster Linux - Newbie 3 01-05-2006 09:43 AM

All times are GMT -5. The time now is 11:49 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