Skip to content

Instantly share code, notes, and snippets.

@jiro4989
Created December 9, 2017 17:17
Show Gist options
  • Save jiro4989/f851f039472202234725c193f8a30a59 to your computer and use it in GitHub Desktop.
Save jiro4989/f851f039472202234725c193f8a30a59 to your computer and use it in GitHub Desktop.
ファイル名に含まれる空白文字をアンダースコアに変更してリネームするシェルスクリプト
#!/bin/bash
# -*- coding: utf-8 -*-
for f in * ; do
nf=`echo "$f" | sed -E 's/\s/_/g'`
mv "$f" "$nf"
done
ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment