New exep function which handels pipes and redirects properly
rework mayan backup and restore steps
This commit is contained in:
@@ -365,7 +365,7 @@ showVersion() {
|
||||
}
|
||||
|
||||
exe() {
|
||||
arr=("$@")
|
||||
local arr=("$@")
|
||||
if [ $DRY -ne 0 ] ; then
|
||||
echo -e "\n-- ${arr[@]}"
|
||||
elif [ $VERBOSE -eq 1 ] ; then
|
||||
@@ -375,6 +375,18 @@ exe() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Handle dry run and verbose output for commands containing pipe and/or redirects
|
||||
# exep <COMMAND TO RUN AS STRING>
|
||||
exep() {
|
||||
if [ $DRY -ne 0 ] || [ $VERBOSE -eq 1 ] ; then
|
||||
echo -e "\n-- $1"
|
||||
fi
|
||||
if [ $DRY -eq 0 ] ; then
|
||||
bash -c "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
local START=0
|
||||
|
||||
|
Reference in New Issue
Block a user