- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- difference between $LOGDIR and ${LOGDIR} ?
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
11-18-2005 06:55 AM
11-18-2005 06:55 AM
we are trying to run a job via cron. (hpux 11.11)and have a mixture of these parentheses and want to make sure we get the same result in all cron entries.
Please explain.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 07:14 AM
11-18-2005 07:14 AM
Solutionexample-
echo ${LOGDIR}A $LOGDIRA
Will display variable LOGDIR followed with an A, while LOGDIRA the shell will think it is the variable name.
{} are also used for arrays and some other operations that are available on variables. See man ksh for more.
HTH
-- Rod Hills
and
${LOGDIR}A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 07:26 AM
11-18-2005 07:26 AM
Re: difference between $LOGDIR and ${LOGDIR} ?
It is used for defining a new variable according to the value of previous variable. By defining it like this shell understand that this is a variable previously defined.
For ex.
server1:/home/hp/>>export LOGNAME=123
server1:/home/hp>>echo $LOGNAME
123
server1:/home/hp>>export LOGNAME1=${LOGNAME}newlogname
server1:/home/hp>>echo $LOGNAME1
123newlogname
(The value is new variable is appended to previous value of similar variable)
Some scripting experts will describe it better otherwise.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 07:48 AM
11-18-2005 07:48 AM
Re: difference between $LOGDIR and ${LOGDIR} ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 07:50 AM
11-18-2005 07:50 AM
Re: difference between $LOGDIR and ${LOGDIR} ?
As noted, bounding your variable names with curly braces avoids ambiguitites in what you versus the shell interpret as the variable name.
Personally, I consider it simply good practice to always encapsulate variables within curly braces in shell programming.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 07:53 AM
11-18-2005 07:53 AM
Re: difference between $LOGDIR and ${LOGDIR} ?
${something} represents the value of the some variable.
$(something) represents executing whatever "something" is. This is also represented as `something` in older shells and is still used for backwards compatibility.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2005 08:11 AM
11-18-2005 08:11 AM
Re: difference between $LOGDIR and ${LOGDIR} ?
Thanks to all