Need to run sudo for a normal user script sub-function - Fedora Support Forums and Community
Results 1 to 7 of 7

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2005
    Montreal, Que, Canada

    Wink Need to run sudo for a normal user script sub-function

    I have a script with multiple functions
    function definition1() ...
    function definition2() ...
    function definition3()...

    #When I invoke the script I would like to have

    sudo definition2
    definition 3
    exit 0

    From what I have read, because I want definition2 to be invoked via sudo, I should make it a stand alone script. But I really would like it to remain in this script because of defined variables and functions.

    Is it possible for a standard (non root owned script) to do some work with root's libraries if the script is run by an administrator ?
    Last edited by lsatenstein; 16th April 2018 at 07:00 PM.
    Leslie in Montreal

    Interesting web sites list

Similar Threads

  1. Run script(s) at boot as sudo
    By macallan in forum Using Fedora
    Replies: 6
    Last Post: 25th October 2013, 04:46 PM
  2. How to run sudo command in the script?
    By borispr in forum Using Fedora
    Replies: 2
    Last Post: 4th July 2012, 03:24 PM
  3. Let normal user run script that needs root pemissions
    By Saint Mike in forum Using Fedora
    Replies: 3
    Last Post: 28th July 2007, 09:18 AM
  4. PHP script with sudo user
    By PaLoBo in forum Servers & Networking
    Replies: 0
    Last Post: 18th January 2007, 07:37 PM
  5. Replies: 1
    Last Post: 16th June 2005, 04:03 PM

Posting Permissions

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