#!/bin/sh
var="$1";
OUTPUT=$(echo ${$var,,});
echo $OUTPUT
I tried every possible combination, including escaping certain characters.
I just cant get shell to output my script argument lower cased.
Error:
createmodule.sh: 26: createmodule.sh: Bad substitution
Why is this?
There’s a mistake, try this instead :
You have had a
$in excess.As seen in discussion, never call scripts with
sh scriptif you are not sure that the wanted shell is really ashone. A better approach is to put the good shebang like#!/bin/bash, and thenchmod+x script.shand finally./script.sh