Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- find -type f -exec sh -c '[[ $(sed -n $= $0) -eq 2 ]]' {} ; -exec sed -i '1!d' {} +
- for file in $(ls *.txt)
- do
- LINENUMB=`wc -l $file | cut -f1 -d' '`
- if [[ $LINENUMB == 2 ]]; then
- sed -i '$d' $file
- fi
- done
Add Comment
Please, Sign In to add comment