- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Difference between $( <cmd> ) and `<cmd>` - FO...
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
Discussions
Discussions
Forums
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
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-2005 03:44 AM
тАО03-15-2005 03:44 AM
Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=833315&admit=716493758+1110888850877+28353475
The HP Posix shell behavior is interesting.
'bash', which is a superset of the Posix shell, does *not* behave the same way:
hpux1 ## echo $(cat <<-"EOF"
'NLS_CHARACTERSET'
EOF
)
"NLS_CHARACTERSET"
linux1 ## echo $(cat <<-"EOF"
'NLS_CHARACTERSET'
EOF
)
'NLS_CHARACTERSET'
Also, 'ksh' has the same behavior as 'sh' on HPUX (hard-to-soft change), while, on Linux, 'ksh' behaves the same as 'bash'.
I'm wondering which is "correct".
However, I can see no reason to change the hard quotes to soft, so I would lean toward 'bash's interpretation.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2005 04:01 AM
тАО03-15-2005 04:01 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
I missed the first thread.
I though bash was supposed to be a posix compliant shell.
HP-UX's default shell is posix and ksh is supposed to be almost exactly the same as posix.
I would tend to think if something was wrong, or perhaps the better word is non-compliant, it would be Linux.
They added some enhancements to cron that were never accepted by the proprietary Unix community. Thats just an example.
Maybe just a bug.
I'd suggest linking these two threads into a Linux bugzilla report and see if you get a satisfactory explanation.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2005 05:36 AM
тАО03-15-2005 05:36 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
Again, I can see no reason for changing the ' to " as HP does.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2005 06:00 AM
тАО03-15-2005 06:00 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
hp, solaris, and aix all have the same behavior, while linux is different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2005 06:42 AM
тАО03-15-2005 06:42 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
Well, that *is* interesting.
I wonder what in the world would be the reason for that behavior?!?!?
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2005 12:29 PM
тАО09-12-2005 12:29 PM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
I discussed this with the 'bash' maintainer. It turns out that this is a bug in ksh88 which was fixed in ksh93. The "posix shell" in hpux, aix, and solaris are based on ksh88.
Indeed, in ksh on HPUX, the version is still
"Version 11/16/88"
.
Seems strange that this bug would persist this long.
I hope that some HPer out there might carry this "inside" ?
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2005 01:40 AM
тАО09-13-2005 01:40 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
interesting question.
Only for information, have a look also to this reference document about shells:
http://bcebhagalpur.net/tutorials/shell/shell.htm
http://www.kornshell.com/doc/faq.html
Cheers,
Alex
- Tags:
- ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2005 02:00 AM
тАО09-13-2005 02:00 AM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2011 11:03 PM - edited тАО12-06-2011 11:11 PM
тАО12-06-2011 11:03 PM - edited тАО12-06-2011 11:11 PM
Re: Difference between $( <cmd> ) and `<cmd>` - FOLLOWUP
>wanted to follow up on the previous thread:
>I hope that some HPer out there might carry this "inside"?
Well, it looks like nothing has changed for 11.31, even though it is Unix 2003 branded.
Looking at tusc, shows the double quotes being written to the sh###.1 temp file. So it is bad before cat(1) reads it and echo echoes it.