mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
iiab-diagnostics: Cleaner output if COMMAND NOT FOUND
This commit is contained in:
parent
e2113c5da0
commit
a81856db5d
1 changed files with 11 additions and 3 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
|
||||
|
|
Loading…
Add table
Reference in a new issue