diff options
author | Aaron Ball <nullspoon@oper.io> | 2017-05-18 21:04:53 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2017-05-18 21:04:53 -0600 |
commit | 4e1667fa29c13359241eef6aeb9f38fe3668ad6c (patch) | |
tree | 841d6d43ead2b381720ff34dc198bfcb0066af68 | |
parent | 6235dc7da2126b89d7b86051e35ae5a11101706b (diff) | |
download | andbackup-4e1667fa29c13359241eef6aeb9f38fe3668ad6c.tar.gz andbackup-4e1667fa29c13359241eef6aeb9f38fe3668ad6c.tar.xz |
Fixed grep switches
Stock grep on android does not support long switches (like
--only-matching vs -o, or --quiet vs -q, etc). This replaces all long
grep arguments with their short equivelants.
-rwxr-xr-x | andbackup.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/andbackup.sh b/andbackup.sh index 646c0ce..70e3552 100755 --- a/andbackup.sh +++ b/andbackup.sh @@ -89,13 +89,13 @@ backup_app() { #If app has the flag_delimiter that means options are passed in local preserveCache=false - if [[ 0 = $(echo ${app} | grep --quiet [${flag_delimiter}]; echo $?) ]]; then + if [[ 0 = $(echo ${app} | grep -q [${flag_delimiter}]; echo $?) ]]; then linfo "This app $app has passed in options" - if [[ 0 = $(echo ${app} | grep --quiet "preserveCache"; echo $?) ]]; then + if [[ 0 = $(echo ${app} | grep -q "preserveCache"; echo $?) ]]; then preserveCache=true fi #Need to get app back to std naming (without params) - app=`echo ${app} | grep --only-matching ^.*- | sed s/-//g | cat -` + app=`echo ${app} | grep -o ^.*- | sed s/-//g | cat -` fi # Make sure app is installed @@ -161,10 +161,10 @@ restore_app() { fi # When restoring something with flags need to restore app alone - if [[ 0 = $(echo ${app} | grep --quiet [${flag_delimiter}]; echo $?) ]]; then + if [[ 0 = $(echo ${app} | grep -q [${flag_delimiter}]; echo $?) ]]; then linfo "This app $app had passed in options" #Need to get app back to std naming (without params) - app=`echo ${app} | grep --only-matching ^.*- | sed s/-//g | cat -` + app=`echo ${app} | grep -o ^.*- | sed s/-//g | cat -` linfo "Restoring to std name \"${app}\" while we restore" fi |