Homebash scripting For loop in bash shell. byAlFarhat •July 28, 2015 0 p6.sh #!/bin/bash i=0 for users in `cat /etc/passwd | awk -F: '{print $1}'` do echo "$((i++)): $users" done echo "$i" Tags: bash scripting linux loop in bash shell scripting Facebook Twitter