How do i create a "shell script" as root? [SOLVED]

Really a newbie question, i know, but any how.
I just downloaded and installed a google-drive client and is about to set it all up. Following a guide from github.
https://github.com/astrada/google-drive … tomounting
"Create a shell script named gdfuse in /usr/bin (as root) with this content:"
There were no explanation how to create a shell script. So i just want to know how du i do that?
I assume it's really simple,  when logged in as su in a terminal, but shell script is new to me.
I read a tutorial on creating scripts, (http://linuxcommand.org/wss0010.php) but  dont know how to create the actual file. e.g. if i open leafpad and try to save it in the /usr/bin i presume it's not as root. Or shall i open thunar as root and do it that way?
Last edited by dockland (2015-06-19 21:39:44)

There's seldom need to run graphical application as root. For editing as root, it's best to stick to a text-based editor.
One of the first hits on a ddg search for 'how to create a shell script' was http://www.linfo.org/create_shell_1.html
Last edited by karol (2015-06-19 21:57:23)

Similar Messages

  • Can any one tell me how can i call a shell script from pl/sql

    i like to call shell script from pl/sql procedure.
    can any one suggest how can i do this

    Have you not mastered in asking the same kind of question ?
    First do write a script...
    no one will spoon feed you.
    How can i call a shell script from procedure
    How to call Shell Script from pl/sql block
    -Sk

  • How can i call a shell script from procedure

    I have a shell script.now i am i a situation to call that shell script from one of my procedures and need to get a value from that script.
    can u suggest me that how can a call the shell script from pl/sql?

    Is the same question you asked here
    How to call Shell Script from pl/sql block
    -SK

  • Need Help in creating Unix Shell Script for database

    Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
    Here is the condition which i want to implement.
    1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
    2. Increase size of redolog file.
    3. Load sample schema.
    4. dump the schema.
    5. Create empty db (Script should check if db already exists and drop it in this case).
    6. Create backup using rman.
    7. restore backup which you have backed up.

    This isn't much of a "code-sharing" site but a "knowledge-sharing" site.  Code posted me may be from a questioner who has a problem / issue / error with his code.   But we don't generally see people writing entire scripts as responses to such questions as yours.  There may be other sites where you can get coding done "for free".
    What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
    But the expectation here is for you to write your own code.
    Hemant K Chitale

  • How do i create a backup script

    please how do i create a backup script to run full backup

    user9106453 wrote:
    please how do i create a backup script to run full backupIs there a reason that you don't want to use the one provided with the installation ?

  • Want to create unix shell script for  Clone procedure in 11i and r12

    Want to create unix shell script for Clone procedure in 11i and r12 .Can anyone help me on this as I m new to oracle apps and scripting.
    Thanks in advance .

    user11958935 wrote:
    Thanks but I want it for application cloning ie adcfgclone and autoconfig etc .Please see old threads for similar topic/discussion.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+Rapid+AND+Clone&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+AutoConfig&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Run shell script as root on boot

    Hi!
    I have the need to run a shell script on boot up as root.
    It will not run as any other user because the software that the shell script runs requires root permissions, and I don't use my computer as root. I can't run it at login and use sudo because it would ask for a password and hang.
    How can I have the shell script auto-run at boot (or login) as root?
    Thanks
    Ross

    Hi,
    first of all you can store your shell script anywhere on your system, I prefere the location /usr/local/scripts (this doesn't exist by default).
    Second you have to create a LaunchDeamon script in /Library/LaunchDeamons which execute your shell script at boot as root.
    An example:
    -------------------------snip------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
    1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>YOURIDENTIFIERNAME</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/scripts/YOUR_SCRIPT.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>ROOT</string>
    <key>GroupName</key>
    <string>WHEEL</string>
    </dict>
    </plist>
    -------------------------snap------------------------
    http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemS tartup/Articles/LaunchOnDemandDaemons.html
    To run a script as root during a user login you can configure a LoginHook. To create a LoginHook login as the relating user and type the following commad:
    sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script
    http://support.apple.com/kb/HT2420
    Hope that helps
    Bye Tom

  • [Solved]Run shell script as root on startup

    Hi
    How to start shell script as root on startup?
    When i search online it is all about an rc.local, but I do not have a rc.local, and when I make one myself it does not run the shell script.
    Regards
    Frederik
    Last edited by Fred7109 (2015-05-26 20:13:04)

    Thankyou for the answers, I went into problems so could first answer now. The script is supposed to delete sandboxes I have created with the sandfox script, and also start a new sandbox with sandfox.
    Regards
    Frederik

  • How do I create a folder in the root directory

    Hi
    How do I create a folder in the root directory?
    Once I do that I need to create a note book file in that folder
    Any help would be much appreciated
    Thanks
    Brian

    Hi Brian,
    Open Macintosh HD in the Finder, then SHIFT+CMD+n
    Root Directory is the top level of the drive.

  • How to create power shell script to upload all termset csv files into the SharePoint2013 local taxonomy ?

    Hi Everyone,
    I want to create a powershell script file
    1) Check a directory and upload all termset csv files into the SharePoint local taxonomy.
    2) Input paramaters - directory that containss termset csv files, Local Termstore to import to,
    3) Prior to updating get a backup of the existing termstore (for rollback/recovery purposes)
    4) Parameters should be passed in via XML file.
    Please let me know how to do it.
    Regards,
    Srinivas

    Hi,
    Please check this link
    http://termsetimporter.codeplex.com/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Creating simple shell script packages to deploy with ARD and TaskServer

    I am looking for a simple step by step on how to create a package that can be deployed using ARD, to run a simple shell script like
    "softwareupdate -i -a"
    A brief search here returned nothing, but perhaps I was not using the correct terms.
    Ultimately, I want to use ARD to run software update on ~400 Macs.
    Thanks in advance for your help.
    Bill

    If I send it as a unix command, it will run only on machines that are currently awake and responding to ARD.
    If I can set it up as a package, then I can use Task Server to "deploy" the command to machines that are not currently online. When the machines next contact the Task Server, they will be told to run softwareupdate.

  • Trying to create a shell script to cut/paste files in finder. Help needed.

    I'm trying to create an automator shell script to cut/paste. It'll function exactly like copy/paste. i.e. I'll just copy file/files with command+c like always, but then I'll create an automator which uses the "mv" terminal app to move the files which works exactly like cut paste.
    I need some help since I don't know the syntax for creating shell scripts.
    What I did so far is to do it in automator with Apple Script which goes like the following:
    on run {input, parameters}
    tell application "Finder"
    set theWindow to window 1
    set thePath to quoted form of (POSIX path of (target of theWindow as string))
    end tell
    tell application "Terminal"
    do script with command "mv \"" & input & "\"" & thePath in window 1
    end tell
    return input
    end run
    This gets the copied file path from clipboard before, as input, and then recognizes the active finder window as thePath so then executes the mv command for the input file to the thePath window.
    It doesn't work as expected since it connects both file/window paths into a single path instead of leaving a space between them so the mv command can't recognize two separate paths.
    What's the correct syntax for that line
    do script with command "mv \"" & input & "\"" & thePath in window 1
    to leave a space between input and thePath under the mv command?
    Also this requires the terminal app to be open in the background.
    After I get this to work I want to do the exact same thing using shell script within automator, so I won't need Terminal to be open all the time.
    And the next step will be to cut/paste multiple files/folders but that should be easy to do once I get the hang of it.

    Try using:
    on run {input, parameters}
    tell application "Finder"
    set theWindow to window 1
    set thePath to quoted form of (POSIX path of (target of theWindow as string))
    end tell
    do shell script "mv \"" & input & "\" " & thePath
    return input
    end run
    (45977)

  • How do I run a shell script via AppleScript?

    Seems obvious, "do shell script" but that doesn't work for me.
    I have an Automator app which runs a shell script, I'd like to take that into an AppleScript. My AS doesn't run the shell script. Perhaps "do shell script' is expecting the script to be located elsewhere? The rest of my AS runs fine, but the shell script doesn't.
    repeat with i from 1 to count of items in exportFolder
      do shell script
              "exiftool -overwrite_original -Photoshop:CopyrightFlag='True'"
      done
    end repeat
    As I say this works within an Automator app, what changes do I need to make it work in AppleScript?
    Thanks!

    Camelot wrote:
    repeat with i from 1 to count of items in exportFolder
    What is 'exportFolder'? Where is it defined?
    Thanks, 'exportFolder' is defined earlier in the script. The purpose of the script - which is run from within Aperture - is to rename the selected images, export them (to the 'exportFolder'), reset the version name and, using ExifTool, add metadata which Aperture does not write to exported JPEGs.
    I have a version of this which works in Automator but I couldn't see any clues there on setting the path to ExifTool.
    Here's the full (modified) script. Currently it returns an error
    Result:
    error "No file specified" number 1
    so I now need to understand if I can use 'exportFolder' (defined at the start) to tell Finder which folder to use.
    -- Creating filenames by making Version Name  from the IPTC Headline and Filename (with hypens where spaces exist). The Aperture Version Name is used to create the file's name on export. Once exported the Aperture Version Name is reset to its original.
    tell application "System Events"
              set exportFolder to (choose folder with prompt "Choose an export folder")
    end tell
    tell application "Aperture"
              set theSel to (get selection)
              if theSel is {} then
                        error "Please select an image or two!."
              else
                        repeat with theImg in theSel
      -- Creating a new Aperture Version Name which will become the exported file's filename.
                                  tell theImg
                                            set headline to (get value of IPTC tag "Headline" of theImg)
                                            set AppleScript's text item delimiters to " "
                                            set theTextItems to text items of headline
                                            set AppleScript's text item delimiters to "-"
                                            set headline to theTextItems as string
                                            set AppleScript's text item delimiters to {""}
                                            set objectName to (get value of IPTC tag "ObjectName" of theImg)
                                            set newVersion to (headline & "-" & objectName) as string
                                            set name of theImg to newVersion
                                  end tell
                        end repeat
      -- Exporting the files as JPEGs to chosen folder/Project Name using the Version Name as a filename
                        export theSel using export setting "JPEG - Original Size" to exportFolder
      -- Resetting the Aperture Version Name back to filename using IPTC Title (which should be the file's filename without suffex).
                        repeat with theImg in theSel
                                  tell theImg
                                            set title to (get value of IPTC tag "ObjectName" of theImg)
                                            set name of theImg to title
                                  end tell
                        end repeat
              end if
    end tell
    --Using ExifTool to set Photoshop Copyright Status etc
    tell application "Finder" to set theFiles to files of exportFolder as alias list
    repeat with eachFile in theFiles
              do shell script "/usr/bin/exiftool -overwrite_original -Photoshop:CopyrightFlag='True' -Photoshop:URL='http://davidgordon.co.uk/'" & quoted form of POSIX path of eachFile
    end repeat
    display dialog "Done that!" with icon note buttons "OK" default button 1 giving up after 10

  • How do I create a trigger script for BOT on Xcode 5 CI?

    When creating a bot for xcode 5 CI, I am offered to use custom script to trigger on every commit. how do I create this script?
    xcode help page: https://help.apple.com/xcode/mac/1.0/#apdE6540C63-ADB5-4B07-89B7-6223EC40B59C
    Click Schedule, then change the settings as desired.
    Example values are shown with each setting.
    Schedule:
    Choose to run manually, periodically, on new commits, or on trigger scripts.

    Did you ever figure this out?
    Been searching the web endlessly without any results.

  • How to check from a shell script that a particular software is installed

    Hai friends
    I want to write a shell script which has to check whether a particular software is installed on the machine, or not. If installed, then what version is it using and the get the version number and which type of installer is it? i mean is it a .rpm installation or a tar.gz installation.
    how can i check this from a shell script. If any of you have any idea please give me a sample script to check this
    Thank you

    @Raja_Abilash
    I don't think this is a right thread & right forum to POST this question.
    better go ahead with forums related to LINUX.

Maybe you are looking for