Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA249      CA318      CA425      CA651

w2mind.computing.dcu.ie      w2mind.org

Missing
DCU student

CASE3 student Paul Bunbury is missing since Thur 2 Feb 2012.
See appeals on crime.ie and garda.ie and facebook.

He is a great coder. See DCU page and boards.ie page.
He won major coding contests in 2010 and 2011.
He is author of the brilliant "FloodItWorld".
DCU can confirm that in Jan 2012 he passed all 6 modules comfortably.


Sample Shell programs



norm - set permissions as open as possible

chmod  u+rwx,go+rx-w  $*



hide - as hidden as possible

chmod  u+rwx,go-rwx  $*



semihide - just open enough as needed for Web

directories:

chmod  u+rwx,g-rwx,o+x-rw  $*
files (web pages, images, etc):
chmod  u+rwx,g-rwx,o+r-xw  $*
CGI scripts:
chmod  u+rwx,g-rwx,o+rx-w  $*
"norm" could of course replace all 3 if you don't mind granting more access than strictly necessary.



rmifexists - silent repeated delete

e.g. Want to be able to repeatedly run:
rmifexists *.bak
and not get error message if no *.bak files found.

for i in $*
do
        if test -f $i
        then
         rm $i
        fi
done



Exercise

Why not:

        if test -f $*
        then
         rm $*
        fi



myspace - which of my directories use the most space

cd $HOME
du | sort -n



wipe - clean up editor backup files

rmifexists *%
rmifexists .*% 

rmifexists  *~
rmifexists .*~

rmifexists  *.bak
rmifexists .*.bak

rmifexists  *.BAK
rmifexists .*.BAK
Certainly easier than having to point-and-click each one.


Exercise

Write a recursive wipe.




Feeds      HumphrysFamilyTree.com

Bookmark and Share           On Internet since 1987.