ServiceCommander-IBMi
ServiceCommander-IBMi copied to clipboard
Feature/sc tail
Explain the reasoning for this pull request. For instance, is it for a new feature, bug fix, code style/cleanup, or something else? If fixing an open issue, please link to it here.
Add wrapper script for getting live tail of current service. Here is an example command line call for getting the tail of a log file:
/QOpenSys/pkgs/bin/sc loginfo $1 | /QOpenSys/pkgs/bin/cut -d ':' -f 2 | /QOpenSys/pkgs/bin/xargs tail
- The "|" symbol is used to pipe the output of the "cut" command to the "xargs" command.
- The "xargs" command is used to pass the path to the log file as an argument to the "tail" command.
- The "tail" command will display the last 10 lines of the log file by default.
Any additional comments/context?
TODO:
- [ ] formalize tail logic
- [ ] formalize calling
sc
command - [ ] add tail optional arguments https://man7.org/linux/man-pages/man1/tail.1.html
- (already supporting
-f
optional argument)
- (already supporting