Find the answer to your Linux question:
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 {} \;"); ...
  1. #1
    Linux 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.


    Code:
    #!/usr/bin/perl                                                    
    use strict; 
    use warnings;
    
    system ("find /home/joan/.mozilla/firefox -name .parentlock -exec rm {} \;");
    The error I get is: /.mozilla/firefox: No such file or directory

    I assume this has to do with the fact that .mozilla directory is hidden???
    Any suggestions please?

    Thank you
    Last edited by goude; 10-07-2009 at 11:05 AM.
    One Love!!!

  2. #2
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    The path there is wrong in the error:-
    Code:
    /.mozilla/firefox
    ...should be something like...
    Code:
    ~/.mozilla/firefox
    /home/$USER/.mozilla/firefox
    It's reading a hard path from root (/ ). Is that the exact code you're using above?

  3. #3
    Linux 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!!!

  4. #4
    Linux 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?

  5. #5
    Linux User
    Join Date
    Jul 2007
    Location
    Greece
    Posts
    277
    Is generated by this variable:

    Code:
    my $user=`whoami`;
    One Love!!!

  6. #6
    Linux User
    Join Date
    Jul 2007
    Location
    Greece
    Posts
    277
    I changed it a bit to:

    Code:
    my $user=`whoami`; 
    my $dir= '/home/$user';
    
    system("find $dir/.mozilla/firefox/ -name .parentlock -exec rm {} \;");
    Error: find: missing argument to `-exec'

    --------------------------------------------------------
    Code:
    my $dir= '/home/$user';
    should be
    Code:
    my $dir= "/home/$user";
    But now I get the same error as before.
    Last edited by goude; 10-07-2009 at 11:57 AM.
    One Love!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...