unix - Double exclamation in bash script -


I know that when double exclamation is printed, it executes the previous command. But echo !! Some strange results that I do not understand. For example, when commands are typed in the command, it also prints the echo as part of the output

  echo $$ !! It prints the output below: $ echo per resonant 3150 (why does echo before each output?) 

When you use history replacement, the shell first represents the command, which is about executing with all the depositions shown, and then executes it. That's because you can see what the resulting command is, to confirm that it is expected by you.

So if you type:

  Echo some commands !!  

!! is replaced with the contents of the previous command, it displays and then executes

  some commands  
< / Html>

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -