Created
May 18, 2016 08:51
-
-
Save ahmedengu/a0e59c2c00479f6b68fa3f547e45d703 to your computer and use it in GitHub Desktop.
bash sorting script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
read -p "enter n " n | |
declare -a ARR | |
for (( c=0; c<$n; c++ )) | |
do | |
read -p "enter " ARR[$c] | |
done | |
ARR2=( $( | |
for tmp in "${ARR[@]}" | |
do | |
echo "$tmp" | |
done | sort) ) | |
echo ${ARR2[*]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment