bash


 変数testpathに/home/sekino/Linux/how.to.linuxという値を設定しておくと、
 $ echo ${testpath##/*/}
 how.to.linux
 $ echo ${testpath#/*/}
 sekino/Linux/how.to.linux
 $ echo ${testpath%%.*}
 /home/sekino/Linux/how
 $ echo ${testpath%.*}
 /home/sekino/Linux/how.to
 #!/bin/sh
 file=scan01.jpg
 echo ${file}
 echo ${file%jpg}
 echo ${file%jpg}png
 変数を数値として扱いたいときは、declareコマンドで指定します。
 declare -i test
 test=1
 test=$test+1
 echo $test