In bash, how can I print the first n elements of a list?
bash
n
For example, the first 10 files in this list:
FILES=$(ls)
to do it interactively:
set $FILES && eval eval echo \\\${1..10}
to run it as a script, create foo.sh with contents
N=$1; shift; eval eval echo \\\${1..$N}
and run it as
bash foo.sh 10 $FILES