Skip to content

Instantly share code, notes, and snippets.

@anaray
Created June 8, 2015 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaray/1b938ff150d4cbd987c2 to your computer and use it in GitHub Desktop.
Save anaray/1b938ff150d4cbd987c2 to your computer and use it in GitHub Desktop.
remove new line from files inside a directory
#here file is renamed to <file>_edited, change as per requirement
for file in <file_base_location>/*
do
echo $file
sed '/^$/d' $file > ${file}_edited
#rm -f $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment