HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command " $@"
Operating System - HP-UX
1829023
Members
2776
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2007 11:12 AM
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2007 02:38 PM
01-07-2007 02:38 PM
Solution
it sort of depends on the shell your using.
but, in the korn shell, it stands for the expandsion of the positional parameters. ksh expands the positional parameters starting with $1, separating them with space characters.
"$@" is equivalent to "$1" "$2" up to "$n" where n is the value fo $#.
where there are no positional parameters, ksh expands "$@" to an unquoted null string
and you can not initalize or assign vaules to the variable @
but, in the korn shell, it stands for the expandsion of the positional parameters. ksh expands the positional parameters starting with $1, separating them with space characters.
"$@" is equivalent to "$1" "$2" up to "$n" where n is the value fo $#.
where there are no positional parameters, ksh expands "$@" to an unquoted null string
and you can not initalize or assign vaules to the variable @
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 12:16 AM
01-08-2007 12:16 AM
Re: Command " $@"
Hi,
the special meaning of "$@" is, that it keeps embedded spaces (or other characters of $IFS) in its usage.
myscript a 'b c' 'd e f'
will report (echo $#) three parameters.
Using a
myotherscript $*
in 'myscript' will send six parameters to 'myotherscript', while
myotherscript "$@"
will keep the original three.
mfG Peter
the special meaning of "$@" is, that it keeps embedded spaces (or other characters of $IFS) in its usage.
myscript a 'b c' 'd e f'
will report (echo $#) three parameters.
Using a
myotherscript $*
in 'myscript' will send six parameters to 'myotherscript', while
myotherscript "$@"
will keep the original three.
mfG Peter
The Universe is a pretty big place,
it's bigger than anything anyone has ever dreamed of before.
So if it's just us, seems like an awful waste of space, right?
Jodie Foster in "Contact"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 12:46 AM
01-08-2007 12:46 AM
Re: Command " $@"
hi manuales,
see also http://www.injunea.demon.co.uk/pages/page212.htm#15.5
for more examples on $# and $@
hope this helps too!
kind regards
yogeeraj
see also http://www.injunea.demon.co.uk/pages/page212.htm#15.5
for more examples on $# and $@
hope this helps too!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP