About 269,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. 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 …

  3. 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 …

  4. 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 …

  5. 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". …

  6. linux - Run a shell script in new terminal from current terminal ...

    Nov 30, 2012 · To write a shell script, do this on your command prompt: echo -e '#!/bin/sh\n echo "hello world"' > abc.sh This writes: #!/bin/sh echo "hello world" To a file called abc.sh. Next, …

  7. How can I call a shell script from Python code? - Stack Overflow

    Sep 23, 2010 · If you have your script written in some .sh file or a long string, then you can use os.system module. It is fairly simple and easy to call: import os os.system("your command …

  8. linux - How to repeatedly run bash script every N seconds

    Apr 30, 2019 · In linux you can use the watch program to repeat an action. Assuming that script.sh is executable: watch -n 10 path/to/script.sh Would run it every 10 seconds. To make …

  9. 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 …

  10. 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 …

Refresh