Never Use Aliased Command in Shell Scripts

In order to fix the error code problem in mysqldump, I have to use the following code explicitly:

mysqldump -u root --default-character-set=latin1 -p trekshot > trekshot.sql
so I created the alias command in file .bashrc for my bak shell script npu
alias msd='mysqldump -u root --default-character-set=latin1 -p trekshot > trekshot.sql'
#!/bin/bash
#
msd
tar -zcpvf bak.tgz www/p/ www/wp-v1.0/ www/img/page/ trekshot.sql .bashrc npu nup
rm -f trekshot.sql
cp bak.tgz bak.tgz.bak
mv bak.tgz bak.tgz.bak /media/A8/
umount /media/A8
echo "Good work! Now pull the udisk out. ;)"

Then I was told that command msd was not found. It turns out that Only raw commands are allowed in shell scripting.

posted @ 2011-03-12 16:37  Trekshot  阅读(317)  评论(0编辑  收藏  举报