I use md5sum to generate a hash value for a file. But I only need to receive the hash value, not the file name. md5=`md5sum ${my_iso_file}` echo ${md5} Output:...
I’m trying to get the contents of a directory using shell script. My script is: for entry in `ls $search_dir`; do echo $entry done where $search_dir is a relative...
I am using SH shell and I am trying to compare a string with a variable’s value but the if condition is always execute to true. Why? Here is...
This question already has answers here: How do I run a program with a different working directory from current, from Linux shell? (11 answers) Closed 7 years ago. I...
Is there a way to get find to execute a function I define in the shell? For example: dosomething () { echo "Doing something with $1" } find ....
I’m running Firefox on a Xvfb in a VPS. What I want to do is to take a full page screenshot of the page. I can redirect Firefox to...
I have gotten the following to work: for i in {2..10} do echo "output: $i" done It produces a bunch of lines of output: 2, output: 3, so on....
What is the difference between =, == and -eq in shell scripting? Is there any difference between the following? [ $a = $b ] [ $a == $b ]...
Lets say I have a shell / bash script named test.sh with: #!/bin/bash TESTVARIABLE=hellohelloheloo ./test2.sh My test2.sh looks like this: #!/bin/bash echo ${TESTVARIABLE} This does not work. I do...
This question already has answers here: Unexpected operator error [duplicate] (4 answers) Closed 6 years ago. My code: #!/bin/sh #filename:choose.sh read choose [ "$choose" == "y" -o "$choose" ==...