Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- typeset -a array
- cat <<CAT | while read -a array
- a b c d
- b c d a
- c d a b
- d a b c
- CAT
- do
- echo ${array[@]} >> data
- typeset -i i
- for ((i = 0; i < ${#array[@]}; i++))
- do
- if echo ${array[$i]} | grep '^a' >& /dev/null
- then
- echo "${array[$i]} found"
- else
- echo 'not found'
- fi
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement