In a message of Thu, 21 May 2015 15:54:20 +0100, Bod Soutar writes: >ls *.pyc *.pso >> .hidden > >should work > >root@localhost:~# mkdir hide_test >root@localhost:~# cd hide_test/ >root@localhost:~/hide_test# touch a.pyc b.pyc c.pyo d.py e.txt >root@localhost:~/hide_test# ls >a.pyc b.pyc c.pyo d.py e.txt >root@localhost:~/hide_test# ls *.pyc *.pyo >> .hidden >root@localhost:~/hide_test# cat .hidden >a.pyc >b.pyc >c.pyo >root@localhost:~/hide_test# > >As this adds specific results of ls you will need to schedule the >command through cron to get it to automatically add new files > >-- Bodsda
If you keep appending the results of ls to your .hidden file it will grow to enormous size. (Cron will be happy to do that for you. :) ) So, if all you care about is the files you have _today_ then use > not >> so that the file is recreated. If, on the other hand, you want your .hidden to list files that you had at one time, don't happen to have now, but want to have hidden if ever you should make them again, then you need to periodically run the commands sort -u .hidden >newhidden #or whatever you want to call it mv newhidden .hidden Laura _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor