Pokazywanie postów oznaczonych etykietą bash. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą bash. Pokaż wszystkie posty

sobota, 13 lutego 2016

bash: $0 value

When a script is run from a command line then the 0th parameter is the script's name. However, when a script is run via source command, then the 0th parameter is a shell name. Weird, but true.


$ cat test.sh 
echo "\$0 is $0"

$ bash test.sh
$0 is test.sh

$ source ./test.sh
$0 is bash

piątek, 26 września 2014

Fork bomb in Windows

It's really simple. Just install Cygwin, write fork bomb (even by accident) and finally run in bash - works fine. I had to restart my machine with restart button.