Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- export FNAME=$1
- function next() { echo $1; }
- function rest() { shift; echo $*; }
- space=" "
- echo '' > results.txt
- function shifter() {
- strings=$*
- for i in $strings; do
- strings=$(rest $strings)$space$(next $strings);
- if [ $(next $strings) != 'and' ]; then
- echo $strings;
- echo $strings >> results.txt;
- fi
- done
- }
- while read name
- do
- #strings=$(<"$FNAME");
- shifter $name ;
- done < "$FNAME";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement