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: Result of executing show sessions command
> show sessions
Date 20XX/01/07 12:00:00 UTC
operator console  -----  0   Jan  6 14:16
operator ttyp0    -----  2   Jan  6 14:16 (192.168.3.7)
operator ttyp1    -----  3   Jan  6 14:16 (192.168.3.7)
operator ttyp2    admin  4   Jan  6 14:16 (192.168.3.7)
Figure 5-10: Filter show sessions command executions by grep command
> show sessions | grep admin
operator ttyp2    admin  4   Jan  6 14:16 (192.168.3.7)
>