- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: What is the meaning of @ itno a script???
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
03-15-2006 06:03 AM
03-15-2006 06:03 AM
into a script, what is the meaning of "@" as folows:
umask $@
thanks ...
Manuale.s
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 06:10 AM
03-15-2006 06:10 AM
SolutionIn a shell script, $@ represents the (positional) arguments passwd to the script. For instance:
# cat my.sh
echo $@
# ./my.sh abc
abc
# ./my.sh abc def
abc def
Hence in the case you show, the assumption is that your script is to receive the octal umask value as an argument to set 'umask'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 06:16 AM
03-15-2006 06:16 AM
Re: What is the meaning of @ itno a script???
$@ is a positional parameter that provides a list of all arguments.
So does $*, BUT the key is that $@ provides a list of strings whereas $# provides *one* long string containing all arguments.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 06:27 AM
03-15-2006 06:27 AM
Re: What is the meaning of @ itno a script???
$# returns the decimal number of arguments passed.
$* is like $@ unless you double quote $* like:
"$*" in which case each positional parameter (argument) acts like you wrote:
$1${IFS}$2${IFS}...
...where ${IFS} is the current Inter Field Seperator.
Pass various arguments (one or more) to this script to see the differences:
# cat my.sh
#!/usr/bin/sh
IFS=":"
echo $@
echo $*
echo "$@"
echo "$*"
# ./my.sh a b c
# ./my.sh "a b c"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 07:29 AM
03-15-2006 07:29 AM
Re: What is the meaning of @ itno a script???
:0)
Manuales.