Results 1 to 6 of 6
Hi everyone
I've written this perl line to delete the .parentlock file in firefox directory.
Code:
#!/usr/bin/perl
use strict;
use warnings;
system ("find /home/joan/.mozilla/firefox -name .parentlock -exec rm {} \;");
...
- 10-07-2009 #1Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
deleting .parentlock file of firefox
Hi everyone
I've written this perl line to delete the .parentlock file in firefox directory.
The error I get is: /.mozilla/firefox: No such file or directoryCode:#!/usr/bin/perl use strict; use warnings; system ("find /home/joan/.mozilla/firefox -name .parentlock -exec rm {} \;");
I assume this has to do with the fact that .mozilla directory is hidden???
Any suggestions please?
Thank youLast edited by goude; 10-07-2009 at 11:05 AM.
One Love!!!
- 10-07-2009 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
The path there is wrong in the error:-
...should be something like...Code:/.mozilla/firefox
It's reading a hard path from root (/ ). Is that the exact code you're using above?Code:~/.mozilla/firefox /home/$USER/.mozilla/firefox
- 10-07-2009 #3Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
yes that's the one I'm using.
You are right at least it should point out the whole directory (/home/$USER/.mozilla/firefox) in the error.One Love!!!
- 10-07-2009 #4Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Is the /home/joan/ part generated by a variable or is it literally as it reads there?
- 10-07-2009 #5Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
Is generated by this variable:
Code:my $user=`whoami`;
One Love!!!
- 10-07-2009 #6Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
I changed it a bit to:
Error: find: missing argument to `-exec'Code:my $user=`whoami`; my $dir= '/home/$user'; system("find $dir/.mozilla/firefox/ -name .parentlock -exec rm {} \;");
--------------------------------------------------------
should beCode:my $dir= '/home/$user';
But now I get the same error as before.Code:my $dir= "/home/$user";
Last edited by goude; 10-07-2009 at 11:57 AM.
One Love!!!


Reply With Quote