- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Shell command execution
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
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
The core node you are trying to access is permanently deleted.
- 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
07-18-2006 04:38 PM
07-18-2006 04:38 PM
The following command is not working:
[root@localhost tmp]# a=`echo Hello!`
-bash: !`: event not found
The document says "exclamation mark" triggers the Bash "history mechanism."
Can someone explain in detail?
TIA.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2006 05:40 PM
07-18-2006 05:40 PM
Re: Shell command execution
try
a='Hello!
or a=`echo "$SomeVar"'Hello!'`
The single quotes form a literal string.
Check bash man page for QUOTING.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2006 05:47 PM
07-18-2006 05:47 PM
Re: Shell command execution
the following will work:
a=`echo Hello\!`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2006 02:00 AM
07-19-2006 02:00 AM
SolutionYou get this error because in the bash shell if you run !something, the shell tries to find the last command that starts the word "something", that is, the ! is a special character for bash.
For example:
ls /usr/share/doc
echo "Hello"
!ls
The last command will run ls /usr/share/doc again.