Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function drop_first ()
- {
- local line
- # skip
- read line;
- # proxy
- while read line; do
- echo $line;
- done;
- }
- function join ()
- {
- local delimeter="$1"
- sed -e "s/^/${delimeter}\n/g" | drop_first | xargs
- }
- echo "1a 1b
- 2a 2b 2c
- 3a" | drop_first | join "delim"
- # result: '2a 2b 2c delim 3a'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement