Quantcast
Channel: Script to convert many binary files to ASCII - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Answer by steeldriver for Script to convert many binary files to ASCII

$
0
0

Simple for loop:

for f in ./*.gz; do
    convert.py "$f" > "${f%.gz}.txt"
done

Using the find command:

find . -maxdepth 1 -name '*.gz' -exec sh -c 'convert.py "$1" > "${1%.gz}.txt"' sh {} \;

or

find . -maxdepth 1 -name '*.gz' -exec sh -c '
  for f; do convert.py "$f" > "${f%.gz}.txt"; done
' sh {} +

(there's really no advantage to using find in this case).


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>