Demo entry 6757094

bash test

   

Submitted by qbbr on Aug 07, 2018 at 09:39
Language: Bash. Code size: 404 Bytes.

#!/usr/bin/env bash

file="script.bash"

cd ~
mkdir -p scrpts/bash && cd $_
pwd
touch ${file}
chmod +x ${file}
chown 1000:1000 ${file}
#vim ${file}

echo '#!/usr/bin/env bash
if [[ "$1" -eq "$2" ]]; then
	echo 1;
else
	echo 2;
fi' > ${file}

# where is "script.bash"?
# $ ./script.bash 42 24
# $ ./script.bash 42 42
# $ ./script.bash 42 "42"
# $ ./script.bash 42 " 42"
# output?

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).