LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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: Centos 6.10, Centos 7.3
Posts: 17,524

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


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
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 11:28 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration