I am in need of some help with UNIXLinux particularly sed an
I am in need of some help with UNIX/Linux, particularly sed and awk:
Please help me Display from /etc/passwd a list of users and their shells for those using the
Korn shell or Bash shell. Order the output by the absolute pathname of the shell used.
Thank you.
Solution
from /etc/passwd
first we need to cut itaccording to required specifications
1)cut -d: -f1/etc/passwd
then now use sed command:
2)sed \'s/:.*//\' /etc/passwd
this is to make sure that it seperates the required format
then the last command which is to be used is:
awk -F: \'{print $1}\' /etc/passwd
this is used to print the requiired format
