zentara has asked for the wisdom of the Perl Monks concerning the following question:
------------------------------------------------------------------------------------------#!/usr/bin/perl -w @users=('/home/zentara'); #put all user-root hidden files and hidden dirs into 1 temp dir #this makes it easier to backup second level subdirs foreach $homedir(@users){ opendir DIR, $homedir or warn "Cannot readdir $homedir:$!\n"; @files = grep !/^\.\.?$/, readdir DIR; foreach (@files){push @movem,$_ if -f} foreach (@files){push @movem,$_ if ($_ =~ m!^[.]!)} print "@movem\n"; print "##############################################\n"; } exit;
x z z1 zz sig sig1 sig2 sigs wxyz .Xmodmap sig.perl .bashrc .fvwm2rc .bash_history backup-homex .Xdefaults .Xauthority .profile .Xresources dontfeedtrolls .xinitrc wxyz-root .kc .le .mc .qt .ddd .kde .pan .pfm .ssh .netscape .designer .babygimp .gftp .gimv .fvwm .java .kde2 .sane .skel .ssh2 .vifm .wine .xmms .Xmodmap .tkalbum .bashrc .gnome2_private .tkphone .dosemu .mozilla .gconfd .gnome2 .gphoto .gqview .glabels .gkrellm .fvwm2rc .acrobat .gnucash .gimp-1.2 .pgaccess .regexp .ptknotes .nautilus .bash_history .mhwaveedit .glameswap .autozen .kalyptus .antiword .Xdefaults .gnome-desktop .Xauthority .profile .jpi_cache .gnome_private .Xresources .xinitrc .pornview .adobe .cedit .dillo .gconf .foxrc .gnome .gnupg .gtklp .links .tkfax .sweep .cddbslave .roadmap .rolodex .sylpheed .TinyCA .emacs.d .wine.bak ##############################################------------------------------------------------------------------------------------------
wxyz backup-homex .kc .le .mc .qt .ddd .kde .pan .pfm .ssh .netscape .designer .babygimp .gftp .gimv .fvwm .java .kde2 .sane .skel .ssh2 .vifm .wine .xmms .Xmodmap .tkalbum .bashrc .gnome2_private .tkphone .dosemu .mozilla .gconfd .gnome2 .gphoto .gqview .glabels .gkrellm .fvwm2rc .acrobat .gnucash .gimp-1.2 .pgaccess .regexp .ptknotes .nautilus .bash_history .mhwaveedit .glameswap .autozen .kalyptus .antiword .Xdefaults .gnome-desktop .Xauthority .profile .jpi_cache .gnome_private .Xresources .xinitrc .pornview .adobe .cedit .dillo .gconf .foxrc .gnome .gnupg .gtklp .links .tkfax .sweep .cddbslave .roadmap .rolodex .sylpheed .TinyCA .emacs.d .wine.bak ##############################################Can someone shed some light on why this happens? It has something to do with running it from /. I have got around it by chdiring to /home/user to let root run the script from there, but I really would like to know what is going on. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: losing files when run from /
by Fletch (Bishop) on Jan 16, 2003 at 18:28 UTC | |
|
Re: losing files when run from /
by waswas-fng (Curate) on Jan 16, 2003 at 19:54 UTC | |
by zentara (Cardinal) on Jan 17, 2003 at 15:12 UTC | |
|
Re: losing files when run from /
by Aristotle (Chancellor) on Jan 18, 2003 at 15:15 UTC | |
by chanio (Priest) on Jul 27, 2005 at 19:55 UTC | |
by Aristotle (Chancellor) on Jul 27, 2005 at 20:34 UTC |