Zend certified PHP/Magento developer

Why is /bash_aliases executing when sourced?

I have a .bash_aliases file I’ve been using for a long time. Today I added some commands that are broken into multiple lines (using ).

Since doing that, I can’t source the file to reload it. When I do it gets stuck. It just sits there, with a flashing cursor on a new line, and doesn’t return me to the command prompt.

Initially doing the source command would return the following error (which I’d not had prior to adding the multi-line commands)

-bash: alias: date: not found
-bash: alias: +%Y-%m-%d-%H.%M.%S: not found

So I changed the line:

    /home/waiheke26/sites/www.waihekehoney.co.nz/backups/wp-files-$(date +%Y-%m-%d-%H.%M.%S).tar.gz 

to

    '/home/waiheke26/sites/www.waihekehoney.co.nz/backups/wp-files-$(date +%Y-%m-%d-%H.%M.%S).tar.gz' 

That stopped that error.
But now when I run source ~/.bash_aliases it just sits with a flushing cursor.

I’ve gone through the file, and I can’t see what the issue is.

QUESTION: What is causing this .bash_aliases file to not update when sourced?

Here’s the file (domain name removed)


alias bashupdate="source ~/.bash_aliases";
alias aliases="cat ~/.bash_aliases";

alias wphome="cd /home/waiheke26/sites/www.DOMAIN.co.nz/public";

alias wpsyncfolder="cd /waiheke26/sites/www.DOMAIN.co.nz/backupsync";

alias wpsync="wphome && rsync -va --exclude 'cache' 
    --exclude 'wp-content/uploads' 
    --exclude 'wp-content/cache' 
    --exclude 'wp-content/uploads' 
    --exclude 'wp-content/backups/' 
    --exclude 'wp-content/envato-backups' 
    /home/waiheke26/sites/www.DOMAIN.co.nz/public/ 
    /home/waiheke26/sites/www.DOMAIN.co.nz/backupsync/public/ --delete;

alias wptar="wpsyncfolder && tar -zcf 
    '/home/waiheke26/sites/www.DOMAIN.co.nz/backups/wp-files-$(date +%Y-%m-%d-%H.%M.%S).tar.gz' 
    . 
    && echo 'File backup OK' || echo 'File backup failed'";

alias wpbackup="dbbackup && wpsync && wptar && cleanbackups";

# alias wpbackup="wphome && tar --exclude='./wp-content/uploads' --exclude='./wp-content/cache' --exclude ='./cache' --exclude='./wp-conte$
alias dbbackup="wphome && wp db export --add-drop-table && mv *.sql /home/waiheke26/sites/www.DOMAIN.co.nz/backups/ && echo "Databas$

alias cleanbackups="find /home/waiheke26/sites/www.DOMAIN.co.nz/backups -mtime +7 -delete";

    /home/waiheke26/sites/www.DOMAIN.co.nz/backupsync/public/ --delete;

alias wptar="wpsyncfolder && tar -zcf 
    '/home/waiheke26/sites/www.DOMAIN.co.nz/backups/wp-files-$(date +%Y-%m-%d-%H.%M.%S).tar.gz' 
    . 
    && echo 'File backup OK' || echo 'File backup failed'";

alias wpbackup="dbbackup && wpsync && wptar && cleanbackups";

# alias wpbackup="wphome && tar --exclude='./wp-content/uploads' --exclude='./wp-content/cache' --exclude ='./cache' --exclude='./wp-conte$
alias dbbackup="wphome && wp db export --add-drop-table && mv *.sql /home/waiheke26/sites/www.DOMAIN.co.nz/backups/ && echo "Databas$

alias cleanbackups="find /home/waiheke26/sites/www.DOMAIN.co.nz/backups -mtime +7 -delete";
alias cleanbackups-test="find /home/waiheke26/sites/www.DOMAIN.co.nz/backups -mtime +7 -print";

alias wpdbbackup="wpbackup && dbbackup && cleanbackups";