Skip to content

Instantly share code, notes, and snippets.

@kanekomasahiro
Created April 21, 2021 04:00
Show Gist options
  • Select an option

  • Save kanekomasahiro/b0cd226fea9b710236aacce5aecc7f59 to your computer and use it in GitHub Desktop.

Select an option

Save kanekomasahiro/b0cd226fea9b710236aacce5aecc7f59 to your computer and use it in GitHub Desktop.
shellスクリプトでpathからデータとファイル形式を除去してfile名だけを抽出する.
# file_path=../data/hoge.bin
# file_name=hoge
file_name=$( echo $file_path | cut -d/ -f4 | sed -r 's/(.[^.]+){1}$//g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment