我需要這個bash腳本:如何用bash重命名文檔?
#!bin/bash
echo "Checking if root…."
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi
echo -ne "Downloading NEW hosts blocking file: "
wget -qO /tmp/hosts.txt http://deathsrepo.webege.com/hosts.txt
echo "DONE!"
mv /tmp/hosts.text -b etc/
wget -qO /tmp/hosts.bak http://deathsrepo.webege.com/hosts.bak
mv /tmp/hosts.bak -b etc/
rename .txt . *.text
爲了能夠hosts.text重命名爲主機。同樣當這個軟件包被刪除時,我需要hosts.bak命名爲主機。
你指的是什麼「包裝」? – vezult 2013-02-15 03:13:06