mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-30 05:02:54 +08:00
Add files via upload
This commit is contained in:
parent
0eda4a2b0e
commit
01514c1d44
24
logecho.mrg
Normal file
24
logecho.mrg
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Echo something to current console AND log
|
||||||
|
# Can also handle piped input ( cmd |logecho )
|
||||||
|
# Warning: Has trouble echoing '*' even when quoted.
|
||||||
|
function logecho () {
|
||||||
|
args=$@
|
||||||
|
|
||||||
|
if [ -z "$args" ]; then
|
||||||
|
args='tmp'
|
||||||
|
|
||||||
|
while [ 1 ]; do
|
||||||
|
read -e -t2 args
|
||||||
|
|
||||||
|
if [ -n "$args" ]; then
|
||||||
|
echo $args |tee -a $logfile;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
else
|
||||||
|
echo $args |tee -a $logfile;
|
||||||
|
fi
|
||||||
|
} # END FUNC
|
Loading…
x
Reference in New Issue
Block a user