Browse Source

Improve the cmd slightly so if tr fails (LC/LANG set), it doesn't

truncate the copied in files..
work-f1-1.10.2
John-Mark Gurney 3 years ago
parent
commit
aa28d7850d
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      README.md

+ 1
- 2
README.md View File

@@ -36,8 +36,7 @@ A shell function to do this processing is:
```sh
function clean_code() {
chmod 644 $1
cat $1 | awk "{sub(/[\t ]*\r/,\"\")}1" | expand -t 4 | tr \\200\\205\\211\\221\\222\\223\\224\\226\\231\\244\\261\\265\\302\\327\\342 \'??\'\'\"\"\\-\'??u?x\' > tmp$$
mv tmp$$ $1
(cat $1 | awk "{sub(/[\t ]*\r/,\"\")}1" | expand -t 4 | tr \\200\\205\\211\\221\\222\\223\\224\\226\\231\\244\\261\\265\\302\\327\\342 \'??\'\'\"\"\\-\'??u?x\' > tmp$$ && mv tmp$$ $1) || rm tmp$$
}
find path -type f | while read file; do echo "$file"; clean_code "$file"; done
```


Loading…
Cancel
Save