linux学習における問題と総括

635 ワード

問題1:whileのループ
vim /etc/cron.daily/logrotate
#!/bin/sh

# Clean non existent log file entries from status file
cd /var/lib/logrotate
test -e status || touch status
head -1 status > status.clean
sed 's/"//g' status | while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean
mv status.clean status

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
 
 

tarはどこかに解凍する
tar -zxvf/home/lee/lijiandong/download/jdk-8u25-linux-i586.gz -C .