mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
define function cat_dir() before cat_cmd() [as it was]
This commit is contained in:
parent
2aefa0be35
commit
0398bfa7da
1 changed files with 11 additions and 11 deletions
|
@ -66,17 +66,6 @@ function cat_file() {
|
||||||
cat_file_raw $1
|
cat_file_raw $1
|
||||||
}
|
}
|
||||||
|
|
||||||
function cat_cmd() { # $1 = command + params, $2 = explanation
|
|
||||||
echo " $1 # $2"
|
|
||||||
echo "=IIAB==========================================================================" >> $outfile
|
|
||||||
cmd=$(echo $1 | sed 's/\s.*$//') # Keep command on left; Drop params on right
|
|
||||||
pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right
|
|
||||||
echo "COMMAND: $pth$1 # $2" >> $outfile
|
|
||||||
echo >> $outfile
|
|
||||||
$(echo $1) >> $outfile
|
|
||||||
echo >> $outfile
|
|
||||||
}
|
|
||||||
|
|
||||||
function cat_dir() {
|
function cat_dir() {
|
||||||
echo " $1"
|
echo " $1"
|
||||||
echo "=IIAB==========================================================================" >> $outfile
|
echo "=IIAB==========================================================================" >> $outfile
|
||||||
|
@ -91,6 +80,17 @@ function cat_dir() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cat_cmd() { # $1 = command + params, $2 = explanation
|
||||||
|
echo " $1 # $2"
|
||||||
|
echo "=IIAB==========================================================================" >> $outfile
|
||||||
|
cmd=$(echo $1 | sed 's/\s.*$//') # Keep command on left; Drop params on right
|
||||||
|
pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right
|
||||||
|
echo "COMMAND: $pth$1 # $2" >> $outfile
|
||||||
|
echo >> $outfile
|
||||||
|
$(echo $1) >> $outfile
|
||||||
|
echo >> $outfile
|
||||||
|
}
|
||||||
|
|
||||||
function cat_tail() { # $1 = path/filename; $2 = # of lines, for tail
|
function cat_tail() { # $1 = path/filename; $2 = # of lines, for tail
|
||||||
echo " $1"
|
echo " $1"
|
||||||
echo "=IIAB==========================================================================" >> $outfile
|
echo "=IIAB==========================================================================" >> $outfile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue