Je veux regarder toutes les modifications apportées à un fichier xyz.txt et écrivez-moi le fichier en entier quand il y a un changement. Y a-t-il One Liner (ou un script shell de quelques lignes) pour cela?Regarder un fichier pour le changement
Mise à jour:
# Check if my.cnf has been changed in the last 24 hours
# if yes, as in the following case, simply send the file
# if it has not been changed in the last 24 hours, do nothing.
# find /etc/ -name my.cnf -mtime 0
/etc/my.cnf
# cat /etc/my.cnf | mail [email protected]
Maintenant, si quelqu'un peut montrer comment lier ces deux lignes dans un script shell ou dans 1 commande.
option -e ne semble pas être disponible pour ma version de commande mail – shantanuo
@shantanuo: Voici une question sur Super User à propos de [tuyauterie uniquement lorsque la sortie est non vide ] (http://superuser.com/q/210054/310). –