flycappuccino 2019-04-03
basename example.tar.gz .tar.gz
# => example
FILE="example.tar.gz"
echo "${FILE%%.*}"
# => example
echo "${FILE%.*}"
# => example.tar
echo "${FILE#*.}"
# => tar.gz
echo "${FILE##*.}"
# => gz
# 在bash中可以这么写
filename=$(basename "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}" <?php. if (!empty($_POST)) {. $data1 = $_POST["data1"];$data2 = $_POST["data2"];$fuhao = $_POST["fuh
test-f /etc/resolv.conf &&echo"File /etc/resolv.conf found."||echo"File /etc/resolv.conf not found."