how to run script using sudo

This is a discussion on how to run script using sudo within the Linux Programming forums, part of the Platform Specific Boards category; Hi, I have a problem while running my personnel script . I am using Ubuntu linux and login as user ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    104

    how to run script using sudo

    Hi,

    I have a problem while running my personnel script .

    I am using Ubuntu linux and login as user "Bargi". I have run the autoreconf -i which create a

    script "ABC" ...

    When I run this by simple typing it gives me error that permission denied and none of files are created.

    Then I used sudo ABC
    But this give error that ABC command not found.

    This is part of a project and after running this make files are created.

    I think that sudo help in only running predefined commands.

    Is there a way to run the custom commands.....

    Thanks'

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Probably because "su" doesn't have "." in the path - so if you do "sudo ./ABC" it will work - I know for sure that sudo itself doesn't have any particular [generic] rules about what you can and can't do with it - it does have a way that you can set up a list of commands you can (or can't) execute and only what is [or isn't] in the list is OK. This is part of the sudoers file, if I remember correctly.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    104

    It's not working

    Hi Matsp,

    Thanks for your help......

    But it not working....

    The file ABC is not a executable file.

    You can say that it is some kind of configuration file........and it is created when I source a

    special file BUILD in our project directory.......


    can u tell me to run this as simple sudo ABC ?????????

    Thanks

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You can't run anything non-executable with sudo - just like you can't run it WITHOUT sudo. You need to give sudo something executable to do.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2009, 12:57 AM
  2. using expect script in C program
    By nitinmhetre in forum Linux Programming
    Replies: 1
    Last Post: 12-21-2006, 07:25 AM
  3. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 10:30 AM
  4. how to implementate a registration script
    By TJa in forum C++ Programming
    Replies: 0
    Last Post: 10-28-2005, 02:33 AM
  5. "Premature end of Script Headers"
    By tetradtech in forum Linux Programming
    Replies: 2
    Last Post: 10-09-2002, 10:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21