LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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


Reply
  Search this Thread
Old 06-10-2008, 01:57 AM   #1
mamtasahai1
Member
 
Registered: Jan 2007
Location: India
Distribution: RHEL 5, Fedora 9, Solaris, FreeBSD
Posts: 52

Rep: Reputation: 15
Change postional parameter


Hi... I m using RHEL5. As by Redhat Linux Positional parameters are from $0 - $9. Is there any way to increase this for ex. $0 - $ 15.
Please give me the file associated with positional parameter.
Thanks in advance.....
 
Old 06-10-2008, 06:43 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You are talking about BASH syntax....it is not specific to RedHat (or any other distro)

There are several good books on BASH---eg "BASH Guide for Beginners" and "The Advanced BASH Scripting Guide"(ABS)---both free at tldp.org. I recommend downloading ABS and using it for searches.

From ABS: $1 - $9 = positional parameters #1-9
${10} = positional parameter #10

I don't know how high you can go ( I tried 13 and it worked)

Quote:
Please give me the file associated with positional parameter.
I don't know what you mean by this--eg documentation (see above). If you mean a file in the OS, then I don't think there is such a thing. The parameters are passed to a command in a memory stack---they would only get into a file if you put them there.
 
Old 06-10-2008, 07:28 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See this page http://www.tldp.org/LDP/abs/html/othertypesv.html
By default the normal limit is 10 params (0-9).
If you want to go beyond that, you can use ${10}, ${11} etc or the old school way, use the 'shift' cmd, see sect 4.7 on that page.
 
  


Reply



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
learning sed,awk,postional parameter and functions yawe_frek Programming 3 09-08-2007 08:49 PM
Monitor parameter change locks up system Lsatenstein SUSE / openSUSE 8 02-18-2006 09:46 PM
How to change library parameter? blachan Linux - Newbie 0 07-12-2004 06:16 AM
Change parameter of /etc/sysconfig/network with a script philipina Linux - Hardware 1 03-11-2004 12:59 PM
Change parameter of /etc/sysconfig/network with a script philipina Linux - General 3 03-11-2004 05:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration