次のようなファイルからWindowsファイルパスを削除しようとしています"\abc\"
が、Unixで使用する必要があるコマンドがわかりません。
試しtr -d '\abc\'
ましたが、うまくいきません。他に使用できるコマンドはありますか?
sed を使用:
echo 'c:\path1\abc\dir 2\file.txt' | sed 's/\\abc//'
The following usually works. There is a function in bash called basename which automatically removes all but the file name
filename=$(basename "$fullfile")
example
basename ('C:/test/test.txt')
yields
test.txt