jeudi 23 mai 2019

How to fix an If-statement trying to get the correct statement?

I'm trying to set up an If-statement wanting to show one of two possibilities at a time for each wget. I download a wget for the first time. Than let's say I add to my file another wget. So I rerun the file in which both run successful. I'm trying to figure out how I can have the previous download 'echo already downloaded' while the new one 'echo downloading'? I was just wondering if possible.

I can get already downloaded, or downloading, and both same time. Just not the correct way in which one wget is downloaded already while the other wget is downloading.

# File does not exist
    if [ -e "$i" ]; then
            echo -n "${i##*/} - echo downloading: "
            echo " DONE"    
    fi
# File does exist    
    if [ ! -e "$i" ]; then
            echo -n "${i##*/} - already downloaded: "
            echo " SKIP"  
    fi
        done

I expect to hopefully show downloading for new downloads and already downloaded for the previous ones I downloaded.

Aucun commentaire:

Enregistrer un commentaire