Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- one two
- three
- fish hat
- cat hop
- one two three
- fish hat cat hop
- #!/bin/bash
- #
- # input and output files
- FILE=$1
- FILE2=$2
- #checks to see if the input file exists
- if [ -f $FILE ];then
- echo "file $FILE found!"
- else
- echo "file $FILE does not exist"
- exit 1
- fi
- #check to see if output file is empty
- if [ -s $FILE2 ]; then
- echo "$FILE2 already has data!"
- exit 1
- fi
- #Joins every two input lines
- while read first; do read second; echo "$firstLine $secondLine";
- done < $FILE
- cat $FILE &> $FILE2
- cat $file | paste -d ' ' - -
- cat $file | paste -d ' ' - - > $file2
- done < $FILE
- cat $FILE &> $FILE2
- done <$FILE >$FILE2
Add Comment
Please, Sign In to add comment