What !! means while calling echo [duplicate]
This question already has an answer here:
What does “apt-get install !!” do and how to make it work?
4 answers
Could somebody explain this output?
$ echo !
!
$ echo !!
echo echo !
echo !
$
I expected sedond echo to write only !!
command-line echo
marked as duplicate by karel, Elder Geek, N0rbert, Eric Carvalho, user68186 Feb 20 at 13:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What does “apt-get install !!” do and how to make it work?
4 answers
Could somebody explain this output?
$ echo !
!
$ echo !!
echo echo !
echo !
$
I expected sedond echo to write only !!
command-line echo
marked as duplicate by karel, Elder Geek, N0rbert, Eric Carvalho, user68186 Feb 20 at 13:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
If you view your commandhistory
& decide you want to run command 419 in that history, you can type!419
and it'll execute. Provided answers tell you!!
executes your last command, but it has other uses too :)
– guiverc
Feb 18 at 22:47
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
3
To prevent the!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, egecho '!!'
gnu.org/software/bash/manual/html_node/Quoting.html
– michael
Feb 18 at 23:33
add a comment |
This question already has an answer here:
What does “apt-get install !!” do and how to make it work?
4 answers
Could somebody explain this output?
$ echo !
!
$ echo !!
echo echo !
echo !
$
I expected sedond echo to write only !!
command-line echo
This question already has an answer here:
What does “apt-get install !!” do and how to make it work?
4 answers
Could somebody explain this output?
$ echo !
!
$ echo !!
echo echo !
echo !
$
I expected sedond echo to write only !!
This question already has an answer here:
What does “apt-get install !!” do and how to make it work?
4 answers
command-line echo
command-line echo
asked Feb 18 at 22:27
SanyashSanyash
1035
1035
marked as duplicate by karel, Elder Geek, N0rbert, Eric Carvalho, user68186 Feb 20 at 13:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by karel, Elder Geek, N0rbert, Eric Carvalho, user68186 Feb 20 at 13:48
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
If you view your commandhistory
& decide you want to run command 419 in that history, you can type!419
and it'll execute. Provided answers tell you!!
executes your last command, but it has other uses too :)
– guiverc
Feb 18 at 22:47
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
3
To prevent the!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, egecho '!!'
gnu.org/software/bash/manual/html_node/Quoting.html
– michael
Feb 18 at 23:33
add a comment |
If you view your commandhistory
& decide you want to run command 419 in that history, you can type!419
and it'll execute. Provided answers tell you!!
executes your last command, but it has other uses too :)
– guiverc
Feb 18 at 22:47
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
3
To prevent the!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, egecho '!!'
gnu.org/software/bash/manual/html_node/Quoting.html
– michael
Feb 18 at 23:33
If you view your command
history
& decide you want to run command 419 in that history, you can type !419
and it'll execute. Provided answers tell you !!
executes your last command, but it has other uses too :)– guiverc
Feb 18 at 22:47
If you view your command
history
& decide you want to run command 419 in that history, you can type !419
and it'll execute. Provided answers tell you !!
executes your last command, but it has other uses too :)– guiverc
Feb 18 at 22:47
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
3
3
To prevent the
!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, eg echo '!!'
gnu.org/software/bash/manual/html_node/Quoting.html– michael
Feb 18 at 23:33
To prevent the
!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, eg echo '!!'
gnu.org/software/bash/manual/html_node/Quoting.html– michael
Feb 18 at 23:33
add a comment |
2 Answers
2
active
oldest
votes
!!
means last command.
echo !!
will echo last command, which was echo !
.
add a comment |
Easily explained:
$ echo 1
1
$ !!
echo 1
1
so !!
just repeats the last command, so
echo !!
does excactly what it's supposed to to!
;-)
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
!!
means last command.
echo !!
will echo last command, which was echo !
.
add a comment |
!!
means last command.
echo !!
will echo last command, which was echo !
.
add a comment |
!!
means last command.
echo !!
will echo last command, which was echo !
.
!!
means last command.
echo !!
will echo last command, which was echo !
.
answered Feb 18 at 22:33
Manoj SawaiManoj Sawai
6851720
6851720
add a comment |
add a comment |
Easily explained:
$ echo 1
1
$ !!
echo 1
1
so !!
just repeats the last command, so
echo !!
does excactly what it's supposed to to!
;-)
add a comment |
Easily explained:
$ echo 1
1
$ !!
echo 1
1
so !!
just repeats the last command, so
echo !!
does excactly what it's supposed to to!
;-)
add a comment |
Easily explained:
$ echo 1
1
$ !!
echo 1
1
so !!
just repeats the last command, so
echo !!
does excactly what it's supposed to to!
;-)
Easily explained:
$ echo 1
1
$ !!
echo 1
1
so !!
just repeats the last command, so
echo !!
does excactly what it's supposed to to!
;-)
edited Feb 18 at 23:23
wjandrea
9,46042664
9,46042664
answered Feb 18 at 22:33
FabbyFabby
27.1k1360161
27.1k1360161
add a comment |
add a comment |
If you view your command
history
& decide you want to run command 419 in that history, you can type!419
and it'll execute. Provided answers tell you!!
executes your last command, but it has other uses too :)– guiverc
Feb 18 at 22:47
Same question, although different context: askubuntu.com/q/627781/295286 Effectively duplicate
– Sergiy Kolodyazhnyy
Feb 18 at 23:30
3
To prevent the
!!
from being evaluated (it's being evaluated prior to executing the echo cmd), use quotes, egecho '!!'
gnu.org/software/bash/manual/html_node/Quoting.html– michael
Feb 18 at 23:33