Results 1 to 5 of 5

Thread: Is this a bug?

  1. #1
    Join Date
    Jun 2007
    Location
    The Mistake by the Lake
    Beans
    1,813

    Is this a bug?

    In the .bashrc there is several if conditions that look like
    if [ -f /etc/bash_completion ]
    If they are going to bother to check if the file exist, shouldn't they make sure the file is readable? I'm new to this scripting, but it seemed kind of odd. Wouldn't -r be a better solution?
    Last edited by swoll1980; May 2nd, 2010 at 12:04 AM.
    Quote Originally Posted by Homer J. Simpson
    "Dinner is the perfect break between work, and drunk."


  2. #2
    Join Date
    Jan 2008
    Beans
    4,757

    Re: Is this a bug?

    Good point. But given the way that these files are packaged, they generally have the correct file permissions when you install them, so is never a worry.

    You can't stop human interference / optimism though. But I can't imagine someone chmod -r /etc/bash.bashrc unless they knowingly intended to do that...

  3. #3
    Join Date
    Jun 2007
    Location
    The Mistake by the Lake
    Beans
    1,813

    Re: Is this a bug?

    Quote Originally Posted by ibuclaw View Post
    Good point. But given the way that these files are packaged, they generally have the correct file permissions when you install them, so is never a worry.

    You can't stop human interference / optimism though. But I can't imagine someone chmod -r /etc/bash.bashrc unless they knowingly intended to do that...
    So no then?
    Quote Originally Posted by Homer J. Simpson
    "Dinner is the perfect break between work, and drunk."


  4. #4
    Join Date
    Jan 2008
    Beans
    4,757

    Re: Is this a bug?

    Quote Originally Posted by swoll1980 View Post
    So no then?
    You make perfect sense in your claim for using -r over -f. But I wouldn't regard it as a bug in in that respect. (May be worth wish-listing though).

  5. #5
    Join Date
    Jun 2007
    Location
    The Mistake by the Lake
    Beans
    1,813

    Re: Is this a bug?

    Ok. If it's not important I'll just pretend it never happened.
    Quote Originally Posted by Homer J. Simpson
    "Dinner is the perfect break between work, and drunk."


Bookmarks

Posting Permissions

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