Article Title: displays the code of linux users line by line. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The last question of the Linux learning script requires the learners to use sed and awk properly. The last question is not very accurate yet. Here is my personal script for this question:
#! /Bin/bash
# Output system users ......
PATH =/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin :~ /Bin
Export PATH
Etc_passwd = 'cat/etc/passwd | wc-l'
For (I = 1; I <= $ etc_passwd; I = I + 1 ))
Do
Content_line = 'cat/etc/passwd | sed-n "$ I" p | awk 'in in {FS = ":" }{ print $1 }''
Echo "The $ I account is $ content_line"
Done
The Code uses the for loop as the condition for output information. The sed row is used to segment the row for awk processing.