$ who can know how many landings on the system
$who |wc-l count the number of users
Note: | is a pipe symbol that can be used to establish a pipeline between two programs (pipeline): The WHO output, a WC input, the result of the WC is the number of users who have logged in
Turn the pipeline into a stand-alone command by entering the command into a generic file, and then using chmod to set the permissions for the file to execute.
#! /bin/sh when the first two characters in a file are #!, the kernel scans the rest of the line to see if there is a full path that can be used to perform the interpretation of the program. The kernel will refer to the interpreter with a straight-muttering option, and then with the rest of the command line. Shell scripts are usually #! at first. /bin/sh.
$cat > Nusers creating files, using the input of the cat copy terminal
Contents of the Who |cw-l program
^d ctrl-d says End-of-file
$chmod +x nusers Let the file have permission to execute
$./nusers performing Tests
6 possible test results for output
Shell Review notes----User management