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 - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2014, 10:26 PM   #1
divya_agsrdk
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
Whats the use of () -parentheses


Whats the use of () -parentheses
In the below ex: a=($*) what it means

Shell script to print the command line arguments in reverse order
if [ $# -eq 0 ]
then
echo -e "\nNo arguments entered\n"
else
a=($*)
echo "arguments are"
echo $*
let x=$#
echo "arguments in reverse order are : "
while [ $x -ne -1 ]
do
echo -n " ${a[$x]}"
let x=x-1
done
fi
 
Old 02-27-2014, 10:36 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
In this case you are creating a bash array named "a"

A good introduction to bash arrays
http://mywiki.wooledge.org/BashGuide/Arrays

PS
Please wrap code with bb code tags

[code]
example code box
2nd line
< actually 4 spaces here >3rd line
[/code]

Code:
example code box
2nd line
     3rd line

Last edited by Firerat; 02-27-2014 at 10:37 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl REGX match between parentheses Boomn4x4 Programming 5 11-30-2012 12:42 AM
Help with sed and parentheses. Allis Linux - Newbie 4 12-24-2011 03:16 PM
what is the meaning of underline that before parentheses? skiron.liu Programming 1 06-22-2010 09:35 AM
using sed with parentheses in perl beebop Linux - General 2 07-21-2005 10:41 PM
Emacs config and parentheses jrdioko Linux - Software 0 07-16-2005 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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