From 51592ad78bc8cf40e91fef454fd6e9a3977a1428 Mon Sep 17 00:00:00 2001 From: panda Date: Tue, 7 Mar 2017 10:38:01 +0100 Subject: [PATCH] fixed unary exceptions and posix compatibilty --- gnano | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 gnano diff --git a/gnano b/gnano old mode 100644 new mode 100755 index b23f5c0..15bba34 --- a/gnano +++ b/gnano @@ -30,12 +30,12 @@ if [ "$argument" = "" ]; then fi #OPTIONS: -if [ $option = "--list" ] || [ $option = "-l" ]; then +if [[ $option = "--list" ]] || [[ $option = "-l" ]]; then echo "RECIPIENTS:" gpg --batch --list-only --no-default-keyring --secret-keyring /dev/null $argument exit 1 fi -if [ $option = "--help" ] || [ $option = "-h" ]; then +if [[ $option = "--help" ]] || [[ $option = "-h" ]]; then echo "Usage: gnano [OPTIONS] FILE" echo "" echo "Option GNU long option Meaning" @@ -45,7 +45,7 @@ if [ $option = "--help" ] || [ $option = "-h" ]; then echo "no options giving only a filename the program decyphers the file, edits it, and recyphers it with the correct recipients" exit 1 fi -if [ $option = "--new" ] || [ $option = "-n" ]; then +if [[ $option = "--new" ]] || [[ $option = "-n" ]]; then new=1 echo "STARTING CREATION OF NEW FILE:" echo "your is the task to retrieve the keys or emails of the recipients, I can't do it" @@ -58,7 +58,7 @@ if [ $option = "--new" ] || [ $option = "-n" ]; then fi #LOOP FOR EXISTING FILE: -if [ "$new" -eq "0" ]; then +if [[ $new -eq "0" ]]; then if [ ! -f $argument ]; then echo "FILE NOT FOUND, EXITING" exit 1 @@ -73,7 +73,7 @@ if [ "$new" -eq "0" ]; then recipients+="-r $recipient " done <$tempfile - if [ "$recipients" = "" ]; then + if [[ $recipients = "" ]]; then echo "ERROR retrieving recipients, known issue, retry!" exit 1 fi @@ -82,7 +82,7 @@ if [ "$new" -eq "0" ]; then fi #LOOP OFR NEW FILE: -if [ "$new" -eq "1" ]; then +if [[ $new -eq "1" ]]; then for newrcpt in $(echo $newrecipients | tr "," "\n") do recipients+="-r $newrcpt " @@ -96,4 +96,4 @@ if [ "$new" -eq "1" ]; then fi #clearing tempfile: -rm $tempfile \ No newline at end of file +rm $tempfile