Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- array=(john jeff jerry tom tim sam andrew kris)
- for i in "${!array[@]}"; do
- if [[ $i > 0 ]];then
- echo "${array[$i-1]} is before ${array[$i]} and ${array[$i+1]} is after ${array[$i]}."
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement