#!/bin/bash -x
. $HOME/.bash_profile
var=POJ_2
versionNumber=${var:4:1}
if [ "$versionNumber" = "1" ]; then
echo "Project 1"
elif [ "$versionNumber" = "2" ]; then
echo "Project 3"
else
echo "sorry I don't know!"
exit 0
fi
Linux substring & if
点赞
收藏