|
/bin/bash - variable substitution.
Is it possible with a bash variable to perform multiple substitution strings to one variable?
I have this variable:
echo $clock
TIMEZONE="US/Central"
What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries.
this is where I am at:
echo ${clock:10}
US/Central"
echo ${clock:10#*/}
bash: testing: 10#*/: syntax error: operand expected (error token is "/")
echo ${clock#*/}
Central"
So, am I just missing something.. or can I only do one type of substition with a bash variable?
thanks,
Trey
|