Results 1 to 5 of 5

Thread: Why does chmod with (no?) arguments not give an error message

  1. #1
    Join Date
    Sep 2010
    Beans
    171

    Why does chmod with (no?) arguments not give an error message

    Okay the chmod man page says, " The operator + causes the selected file mode bits to be added to the existing file mode bits of each file"....

    So why does this NOT give me an error message

    Code:
    chmod + ./AdbeRdr9.5.1-1_i486linux_enu.bin
    When this gives does give me an error message?

    Code:
    chmod ./AdbeRdr9.5.1-1_i486linux_enu.bin
    I get it, chmod requires a parameter...what what does the + do if there isn't a valid symbolic constant after it (x,r,w)?

    What does chmod + ./AdbeRdr9.5.1-1_i486linux_enu.bin do?

  2. #2
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,484
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why does chmod with (no?) arguments not give an error message

    It doesn't do anything.
    All you said was add nothing, so it did.
    Using + fulfilled the argument needed.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #3
    Join Date
    Feb 2011
    Location
    /Earth/India/Patna
    Beans
    147
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Why does chmod with (no?) arguments not give an error message

    Quote Originally Posted by venom104 View Post
    Okay the chmod man page says, " The operator + causes the selected file mode bits to be added to the existing file mode bits of each file"....

    So why does this NOT give me an error message

    Code:
    chmod + ./AdbeRdr9.5.1-1_i486linux_enu.bin
    When this gives does give me an error message?

    Code:
    chmod ./AdbeRdr9.5.1-1_i486linux_enu.bin
    I get it, chmod requires a parameter...what what does the + do if there isn't a valid symbolic constant after it (x,r,w)?

    What does chmod + ./AdbeRdr9.5.1-1_i486linux_enu.bin do?
    Hi
    chmod stands for CHange MODe bits of the file.
    when You write + option with it, it means you want to add something to the permissions of the file. (There are 3 options- r(read),w(write) and x(executable).
    Now, as deadflowr stated it, you have not given any option to the file. So, shell reports an error.

    Another point to note is you are trying to change permissions of this file and simultaneously execute this file. This can be better broken into two steps:
    Code:
    chmod +x AdbeRdr9.5.1-1_i486linux_enu.bin
    ./AdbeRdr9.5.1-1_i486linux_enu.bin
    Regards,
    Abhinav

  4. #4
    Join Date
    Sep 2010
    Beans
    171

    Re: Why does chmod with (no?) arguments not give an error message

    Thank you guys. Thread Closed.

  5. #5
    Join Date
    Nov 2012
    Beans
    7

    Re: Why does chmod with (no?) arguments not give an error message

    For more info, run
    Code:
    man chmod

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
  •