- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- backticks doesn't work
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
06-13-2002 11:17 PM
06-13-2002 11:17 PM
It looks like a little problem with backquotes (backticks)
If I insert the following command
echo `uname -n`
the result is
uname -n
instead of the real hostname. So i suggest that there is a problem with the command substitution in correlation with backquotes.
Any hint to resolve this prob
Thanks in advance
Reinhard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:23 PM
06-13-2002 11:23 PM
Re: backticks doesn't work
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:24 PM
06-13-2002 11:24 PM
Re: backticks doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:28 PM
06-13-2002 11:28 PM
Re: backticks doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:29 PM
06-13-2002 11:29 PM
Re: backticks doesn't work
echo `uname -n` works for me. I get my hostname.
Funky keyboard? cat some backticks to a file, do an od, and compare to an ascii table. Are you really typing backticks? Foreticks 'uname -n' or quotes would act as you describe.
Otherwise, something funky in your shell config changing the meaning of delimiters?
greg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:30 PM
06-13-2002 11:30 PM
Re: backticks doesn't work
So i prefer:
echo $(uname -n)
Works with posix-shell and maybe in ksh too.
Hartmut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:33 PM
06-13-2002 11:33 PM
Re: backticks doesn't work
the HOSTNAME=$(hostname)
method is much cleaner (and does work with ksh)
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 11:51 PM
06-13-2002 11:51 PM
Re: backticks doesn't work
uname -n
it's
`uname -n`
Duncan: It's the same behavior in POSIX and Korn Shell.
Alex: The back ticks are the right one, from top left to right bottom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 12:02 AM
06-14-2002 12:02 AM
Re: backticks doesn't work
What shell are you using?
# echo $SHELL
Try this:
# sh
# echo `uname -a`
what is the output you get?
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 12:22 AM
06-14-2002 12:22 AM
Re: backticks doesn't work
The output is still the same: `uname -n`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 12:33 AM
06-14-2002 12:33 AM
Re: backticks doesn't work
Could your server have been rootkit'ed? ;-)
In any case, check the environment:
# sh
# env
# set
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2002 03:57 AM
06-14-2002 03:57 AM
SolutionAs mentioned the preferred way (even bash says 'the old way') is to replace all command substitutions with the $(...) construct. This also makes nesting of commands very simple (no escaping necessary). Now your specific problem may be due to keyboard mapping. All that the shell cares about is the character bitpattern you typed. To decode what the shell sees, do this:
xd
`'
(then type CTRL-D)
0000000 6027 0a00
0000003
What this incantation does is to run the hex decoder program (xd), then you press various keys, followed by CTRL-D which terminates input. xd then displays 6027 which is the hex values for the two characters. 60 is the grave accent (backtick, backqoute, reverse apostrophe, etc) and 27 is the single quote or apostrophe. 0a is the CR or Retrun key and 00 is the marker for the end of an ASCII file.
HINT: man ASCII
Bill Hassell, sysadmin