10 lines
259 B
Bash
Executable File
10 lines
259 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CMD="$1"
|
|
BEFORE_SPACE="${CMD%% *}"
|
|
if command -v "$BEFORE_SPACE" &> /dev/null; then
|
|
eval "$CMD" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/'\''/\'/g'
|
|
else
|
|
echo "$CMD" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/'\''/\'/g'
|
|
fi
|