Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for file in *.txt;
- do
- [ -f "$file" ] && printf 'Processing %s\n' "$file"
- [[ "$file" == *?.* ]] && # If file has a period after at least one character; filters out .bashrc and similar
- file1="./${file%.*}_sorted.${file##*.}" || # For files with extensions ($file becomes file1)
- file1="${file}_sorted"
- # For files without extensions ($file becomes file1)
- LC_ALL=C sort -u "$file" > "./$file1"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement