wripeでバックアップしたtxtファイルの中身からファイル名を変更する
bash script でwripeバックアップファイルの変換処理を書いた 主な内容 bash script Ubuntu 14.04で確認 UTF8,LF変換にnkf のインストールが必要 ファイル変換内容 1行目(wripeタイトル)から、ファイル名決定 ファイル名に使用できる文字列変換 wripeタイトルに日付が入っていた場合の処理をある程度考慮 1行目は削除 UTF8,LF変換 tag 空白4文字変換 起動引数 第一引数:バックアップファイルの保存先 疲れた…. #!/bin/bash DIR_IN=$1 OUT_NAME=out DIR_OUT=$DIR_IN/$OUT_NAME which nkf 1>/dev/null 2>/dev/null RC=$? if [ $RC -ne 0 ]; then echo "nkf not installed!" return fi if [ "" == "$1" ]; then echo "arg1(input directory) is blank!" return fi if [ -d $DIR_IN ]; then # specified directory is exist. if [ -e $DIR_OUT ]; then # out dir is exist....