Skip to content

Instantly share code, notes, and snippets.

@quickgrid
Created March 5, 2016 14:27
Show Gist options
  • Save quickgrid/9208dc6ee0e83c18ba74 to your computer and use it in GitHub Desktop.
Save quickgrid/9208dc6ee0e83c18ba74 to your computer and use it in GitHub Desktop.
shell script for generates numbers using for loop and writes to file
#!/bin/bash
# Generate numbers and save / append in the specified file.
generateNumbers(){
for (( c=1; c<=$1; c++ ))
do
echo $c >> numbers.txt
done
}
generateNumbers $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment