Dude, so sorry about the absolute noob question.
What is the problem with the following code?
I like to have a simple script which says MEH! when there is no input arg, otherwise prints it.
#!/bin/bash
if [${#$1}==0] then
echo "MEH!";
else
echo $1;
fi
OS says the line 4 has a error (unexpected token else at line 4).
So sorry dude.
Thanks in advance.
if [${#$1}==0] then
useif [ $# -eq 0 ]; then
bash
man page. It is quite clear about where whitespace is required and where it is forbidden.