Shell No summary specified. return in CLI - I have no idea what that means.

I don't know how much code you need to see but this chuck , when it is ran due to empty dir it keeps telling me

Code:
empty        0
No summary specified.
either like I modded it to be or using a case statement.
it is just suppose to if source is empty move everything in holding area back to storage. Works on Linux without a hitch, but I think FreeBSD has got ya's I'm not completely aware of.

Code:
#source images directory
empty=$(find "$from" \( -type f -name "*.jpg" -o -type f -name "*.png" \) | wc -l)
echo "empty $empty"
#notify-send "Left" "$empty"
#check storage place if empty 
#then move holding place back to storage place
#case $empty in
#    0)
     if [ "$empty" == '0' ] ; then
        holdingimg=$(find "$moveto" \( -type f -name "*.jpg" -o -type f -name "*.png" \) | wc -l)
        if [[ $holdingimg -gt '0' ]] ; then
            notify-send  "empty::$empty Images moved to" "$holdingimg"
            while read f 
            do
                filename=${f##*/}
                subdir=${f%/*}
                subdir=${subdir##*/}
                echo $subdir
                to=$from/$subdir
                mkdir -p "$to"
                 [[ -f $f ]] && { mv $f $to ; echo "$to/$filename" > "$HOME"/mhsetrootimagefile ; }
             
            done < <(find "$moveto" \( -type f -iname "*.jpg" -o -type f -iname "*.png" \) )
        elif [[ $holdingimg -le '0' ]] ; then
            notify-send " no images to be found in $favimages
            or
            $holding
            exiting ..."
             exit
        fi
        #;;
    fi
    
    #1)
        #img=$images/$(ls $images)
    #    ;;
#esac
 
Okay I got it figured out but not why the case does not work

I changed '==' to '-gt' text to binary check for the if statement
 
Works on Linux without a hitch, but I think FreeBSD has got ya's I'm not completely aware of.
I think most distributons provide a version of BASH as the default shell. FreeBSD comes with Thomson's SHell which has slightly different syntax requirements:

When testing for an empty variable, use of the of the following:

check for null string:
Code:
if [ -z "$empty" ]

Check the string length for numeric equality:
Code:
len=$( /bin/echo "$empty" | /usr/bin/wc -l | /usr/bin/xargs)

Use full if statements with single bracket tests instead of double (see above):

You can also find this information on the manpage: sh(1)
 
Back
Top