About 290,000 results
Open links in new tab
  1. How do I execute a bash script in Terminal? - Stack Overflow

    Mar 9, 2018 · Pretty good summary. Maybe in the last example remind people that script.sh and script.php are the literal file names of these scripts, and that if you put an extension in the file …

  2. linux - How to run a shell script on a Unix console or Mac terminal ...

    Apr 9, 2009 · If you want the script to run in the current shell (e.g. you want it to be able to affect your directory or environment) you should say:. /path/to/script.sh or . source /path/to/script.sh …

  3. How to call one shell script from another shell script?

    Dec 2, 2011 · But even if you add the shebang, it is much faster * to run a script in a sub-shell and capture the output: $(source SCRIPT_NAME) This works when you want to keep running the …

  4. How to execute script in the current shell on Linux?

    To source the script into the current shell: type the command . script.sh or source script.sh; Note: . in bash is equivalent to source in bash. This acts as if you typed in the contents of "script.sh". …

  5. linux - How to run a shell script at startup - Stack Overflow

    Oct 19, 2012 · Add a command to run upon start up, in this case a script: @reboot sh /home/user/test.sh. Save: Press ESC then :x to save and exit, or hit ESC then ZZ (that's …

  6. How do I run a shell script without using "sh" or "bash" commands?

    source ./my-cool-script (or . ./my-cool-script) will pollute the current shell session with any variables defined in the script. Sourcing should not be used unless you want to explicitly …

  7. How do I run .sh or .bat files from Terminal? - Stack Overflow

    Jun 10, 2013 · If you still have problems executing the script, you might want to check its permissions - you must have execute permissions to execute it, obviously. Use. chmod u+x …

  8. linux - Execute a shell script in current shell with sudo permission ...

    Sep 15, 2013 · This doesn't run the script in the same/current shell, like source or . would. It runs a new bash shell as a subprocess of sudo (which is itself run as a subprocess of the current …

  9. How do I run a shell script as root (sudo)? - Stack Overflow

    Nov 16, 2011 · This will not work, the best thing is to put only the requires commands in the shell script. And then setuid the script itself, like this (using root): chmod u+s myscript.sh Like this, …

  10. linux - write a shell script to ssh to a remote machine and execute ...

    Dec 18, 2012 · Connect to remote machine using Expect Script. If your machine doesn't support expect you can download the same. Writing Expect script is very easy (google to get help on …

Refresh