Partial String Matching In Bash Scripts
if [[ $(pwd) == "/path/to/current/directory" ]]
then
echo "You are in that directory";
fiif [[ $(pwd) == *"directory"* ]]
then
echo "You are in that directory";
fiLast updated
if [[ $(pwd) == "/path/to/current/directory" ]]
then
echo "You are in that directory";
fiif [[ $(pwd) == *"directory"* ]]
then
echo "You are in that directory";
fiLast updated