Skip to content

Instantly share code, notes, and snippets.

@jessebutryn
Last active April 19, 2018 18:53
Show Gist options
  • Select an option

  • Save jessebutryn/37c6d0e5a8ffb49a26fcea09e4613308 to your computer and use it in GitHub Desktop.

Select an option

Save jessebutryn/37c6d0e5a8ffb49a26fcea09e4613308 to your computer and use it in GitHub Desktop.
Hello world script
#!/bin/bash
declare -a alph
declare -a prnt
for l in {a..z}; do
alph+=( "$l" )
done
while read -r i; do
if ((i==7)); then
prnt+=( "$(awk '{print toupper($0)}' <<<"${alph[i]}")" )
else
prnt+=( "${alph[i]}" )
fi
done << EOF
7
4
11
11
14
EOF
prnt+=( '<' )
for i in 22 14 17 11 3; do
case $i in
22)
prnt+=( "$(tr '[:lower:]' '[:upper:]' <<<"${alph[i]}")" )
;;
*)
prnt+=( "${alph[i]}" )
;;
esac
done
tr -d ' ' <<< "${prnt[@]}" | sed 's/</, /'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment