bash で次のスクリプトを実行しようとしています。
#! /bin/Bash
cp '../Text_Files_Backups/'*.txt .
sed -i '1,/Ref/d' *.txt
##Deletes all lines from the begining of file up to and including the line that includes the text 'Ref'
##
sed -i -b '/^.$/,$d' *.txt
##Deletes all blank lines and text following and including the first blank line
sed -i 's/\([(a-zA-Z) ]\)\([(1-9)][(0-9)][ ][ ]\)/\1\n\2/g' *.txt
##Searches document for any instance of a letter character immediately followed by a 2 digit number ##immediately followed by 2 blank spaces
## <or>
##a blank space immediately followed by a 2 digit number immediately followed by 2 blank spaces
## and inserts a new line immediately prior to the 2 digit number
exit
各行は個別にテストされており、スクリプトにまとめられている場合を除いて、正常に機能します。
最初のファイルは問題ないようです。次の 4 つのファイルは空白です。次に、次の 2 つのファイルは良好です。これは、これを実行する必要がある 550 個のファイル全体で一見ランダムな間隔で維持されます。
何か案は?
ありがとう。