For loop in bash shell.

p6.sh

#!/bin/bash

i=0
for users in `cat /etc/passwd | awk -F: '{print $1}'`
do
   echo "$((i++)): $users"

done
echo "$i"

Post a Comment

Previous Post Next Post