Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # En este caso, listará y enumerá los usuarios del Sistema.
- # Con nl
- cut -d ':' -f 1 /etc/passwd | nl
- # Con cat
- cut -d ':' -f 1 /etc/passwd | cat -n
- # Con grep
- grep -noE '^[^:]+' /etc/passwd
- # Con while
- i=1
- while read User; do
- echo -e "\t $[i++]: $User"
- done < <(cut -d ':' -f 1 '/etc/passwd')
- # Con for
- i=1
- for User in $( cut -d ':' -f 1 '/etc/passwd' ); do
- echo -e "\t $[i++]: $User"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement