|
A strange thing happened with !
Tested a piece of a shell script at the command line and got an odd and interesting-looking result. (Incidentally I realise there should be a space between the ! and $.)
Question is: Why does the first line give the output it does - the second and thrid lines?
lugo@debian:~$ if [ !$filth ]; then echo 'smegma'; fi
if [ fifilth ]; then echo 'smegma'; fi
smegma
lugo@debian:~$ echo $filth
2
lugo@debian:~$
lugo@debian:~$ echo !$filth
echo Ffilth
Ffilth
lugo@debian:~$ echo !
!
lugo@debian:~$ echo !$
echo !
!
Thanks any help.
|