Skip to content

Instantly share code, notes, and snippets.

@eamexicano
Created November 22, 2013 05:57
Show Gist options
  • Save eamexicano/7595496 to your computer and use it in GitHub Desktop.
Save eamexicano/7595496 to your computer and use it in GitHub Desktop.
Remove carriage return from windows file and create new file. Exclude some files (from a directory) and concatenate into a one big file.
#!/bin/bash
# Remove carriage return from windows file <CR> and createa a new file
tr -d '\015' < windows_file > another_file
# Exclude some files prior concatenation
ls | sort | grep -v -E "(file1|file2|...|fileN)" | xargs cat > large_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment