Skip to main content

Bash


Bash Files

  • Make sure to start your file with #!/bin/bash

Loop Over Files, Counter, Break out of Loop

i=0
for f in $(find $2 -type f -name '*.sqlite' -printf '%f\t%p\n' | sort -k1 | cut -d$'\t' -f2)
do
echo "$i : $f"

if [[ "$i" == '5' ]]
then
break
fi

((i=i+1))
done

Pause for 1 second

read -r -p "Wait 1 second or press any key to continue immediately" -t 1 -n 1 -s