mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
Merge pull request #3901 from holta/iiab-diagnostics_cleaner_cmd-not-found
iiab-diagnostics: Cleaner output if COMMAND NOT FOUND
This commit is contained in:
commit
cb0788b7ba
2 changed files with 12 additions and 4 deletions
|
@ -101,10 +101,18 @@ function cat_cmd() { # $1 = command + params, $2 = explanation
|
|||
spc_params=$(echo "$1" | sed 's/^\s*\S\S*\s*/ /;s/\s*$//') # Drop command on left; Keep a single space + params on right; RTrim
|
||||
#spc_params=$(echo "$1" | sed 's/^\s*\S*//;s/\s*$//;s/^\s\s*/ /') # LTrim + drop original path + command on left; RTrim; Compress whitespace in between
|
||||
#spc_params=$(echo "$1" | sed 's/^[[:blank:]]*[^[:blank:]]*//;s/[[:blank:]]*$//;s/^[[:blank:]][[:blank:]]*/ /') # Equivalent (POSIX compliant)
|
||||
if [[ $2 == "" ]]; then
|
||||
echo "COMMAND: $path_cmd$spc_params" >> $outfile
|
||||
if [[ $path_cmd == "" ]]; then
|
||||
if [[ $2 == "" ]]; then
|
||||
echo "COMMAND: $1" >> $outfile
|
||||
else
|
||||
echo "COMMAND: $1 # $2" >> $outfile
|
||||
fi
|
||||
else
|
||||
echo "COMMAND: $path_cmd$spc_params # $2" >> $outfile
|
||||
if [[ $2 == "" ]]; then
|
||||
echo "COMMAND: $path_cmd$spc_params" >> $outfile
|
||||
else
|
||||
echo "COMMAND: $path_cmd$spc_params # $2" >> $outfile
|
||||
fi
|
||||
fi
|
||||
echo >> $outfile
|
||||
if [[ $path_cmd == "" ]]; then
|
||||
|
|
|
@ -66,4 +66,4 @@ But first off, the file is compiled by harvesting 1 + 6 kinds of things:
|
|||
|
||||
## Source Code
|
||||
|
||||
Please look over the bottom of [iiab-diagnostics](iiab-diagnostics) (lines 127-256 especially) to learn more about which common IIAB files and commands make this rapid troubleshooting possible.
|
||||
Please look over the bottom of [iiab-diagnostics](iiab-diagnostics) (lines 135-268 especially) to learn more about which common IIAB files and commands make this rapid troubleshooting possible.
|
||||
|
|
Loading…
Reference in a new issue