(Video materials in preparation)
rootname : Removes the suffix from a path name
Usage : rootname <path>
Version : Mon Jan 17 11:50:14 JST 2022
Edition : 1
The rootname command outputs <path> with the file suffix removed.
$ rootname /home/usp/hogehoge.c
/home/usp/hogehoge
The rootname command is often used when processing a file and saving
the result to a filename with a different suffix.
For example, converting all Windows CSV files to UTF-8 field fotmat
files.
for csvfile in *.csv; do
uconv -Lu -stou $csvfile | fromcsv - > $(rootname $csvfile).txt
done
basename command = removes the path and returns only the file name
dirname command = returns only the directory name from the path
rootname command = Removes the suffix from the path (USP command)
extname command = Returns the file suffix from a path (USP command)