Bash Advanced Topics: Difference between revisions
From MediaWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
== '''Overview''' == | == '''Overview''' == | ||
The topics below cover various advanced '''[http://www.gnu.org/software/bash bash]''' shell usage that can be applied to NST usage. | |||
== '''Extended Bash Completion''' == | == '''Extended Bash Completion''' == | ||
The | The bash shell's completion function can be extended to external programs. | ||
=== systemctl Bash Completion === | === systemctl Bash Completion === |
Revision as of 06:48, 22 May 2011
Overview
The topics below cover various advanced bash shell usage that can be applied to NST usage.
Extended Bash Completion
The bash shell's completion function can be extended to external programs.
systemctl Bash Completion
The systemd-units RPM package contains a bash completion script ("/etc/bash_completion.d/systemctl-bash-completion.sh") for the systemctl command. Bash completion extension for the systemctl command can be quite useful for its long command argument's naming. To enable it, source it in within your bash shell:
[root@probe ~]# . /etc/bash_completion.d/systemctl-bash-completion.sh
[root@probe ~]#
To use it, lets say to get the status of a serial device (systemctl status serial-getty@ttyS0.service), perform the following:
systemctl stat<tab>
Substitute the "<tab>" for the tab key. This will result in:
systemctl status
Now the next part of the command:
systemctl status seria<tab>
Again substitute the "<tab>" for the tab key. This will result in the full command:
systemctl status serial-getty@ttyS0.service
***Note: If more than one completion value is found, then hitting the tab key will not complete and fill in a value. In this case one may use the <esc> + = key sequence (i.e., The Escape key followed by the Equal Sign key) to find out the possible completion values.