Configuration Guide Vol. 1


5.2.6 Pipe function

Using the pipe function, you can pass command execution results to another command. Passing the results to the grep command can make them easier to understand. However, response messages, such as those indicating that command execution failed, are not passed, and are displayed when a command is executed. Figure 5-9 show sessions Command Execution Results shows the results of executing show sessions command, and Figure 5-10 show sessions Command Execution Results Filtered by grep Command shows the results of executing show sessions command filtered by grep command.

Figure 5-9 Show sessions command execution result
> show sessions
Date 20XX/01/07 12:00:00 UTC
operator console  -----  0   Jan  6 14:16
operator pts/0    -----  2   Jan  6 14:16 (192.168.3.7)
operator pts/1    -----  3   Jan  6 14:16 (192.168.3.7)
operator pts/2    admin  4   Jan  6 14:16 (192.168.3.7)
Figure 5-10 Use the grep command to filter the results of execution of the show sessions command.
> show sessions | grep admin
operator pts/2    admin  4   Jan  6 14:16 (192.168.3.7)
>