How would I write a Linux script to print numbers 1 through n, one on each line. But if n isn't specified, a default value of 10 will be used.
Example: script name is value
./value 20 should print 1 through 20 on each line
./value should print 1 through 10 on each line by default
My Script:
#!/bin/bash
num=$1
for (( i = 1 ; i <= ${num} ; i++ ))
do
echo $i
done