Is there a simple way to comment out a block of code in a shell script? 15 Answers 15
This script is getting an error: elif [ $operation = "man" ]; then if [ $aug1 = "add" ]; then # <- Line 75 echo "Man Page for: add"...
$1 is the first argument. $@ is all of them. How can I find the last argument passed to a shell script? 29 Answers 29
I’m using ls -a command to get the file names in a directory, but the output is in a single line. Like this: . .. .bash_history .ssh updater_error_log.txt I...
Say I want to kill every process containing the word amarok. I can print out the commands I want to execute. But how do I actually make the shell...
Working with xenserver, and I want to perform a command on each file that is in a directory, grepping some stuff out of the output of the command and...
I know the string “foobar” generates the SHA-256 hash c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 using http://hash.online-convert.com/sha256-generator However the command line shell: hendry@x201 ~$ echo foobar | sha256sum aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f - Generates a different hash....
How could I do this with echo? perl -E 'say "=" x 100' 35 Answers 35 You can use: printf '=%.0s' {1..100} How this works: Bash expands {1..100} so...
Example: absolute="/foo/bar" current="/foo/baz/foo" # Magic relative="../../bar" How do I create the magic (hopefully not too complicated code…)? 24 Answers 24
This question already has answers here: Make a Bash alias that takes a parameter? (24 answers) Closed 1 year ago. The community reviewed whether to reopen this question 2...