- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Shell command execution
Operating System - Linux
1753569
Members
6047
Online
108796
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
Hi,
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.
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.
3 REPLIES 3
- 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
L.S.
try
a='Hello!
or a=`echo "$SomeVar"'Hello!'`
The single quotes form a literal string.
Check bash man page for QUOTING.
JP
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
You must prepend the exclamation mark with a backslash
the following will work:
a=`echo Hello\!`
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
Solution
-bash: !`: event not found
You 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.
You 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.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP