About 70 results
Open links in new tab
  1. command line - How do I run .sh scripts? - Ask Ubuntu

    May 1, 2011 · 112 You need to mark shell scripts as executable to run them from the file manager: Right click on your .sh file and select Properties: In the Permissions tab, check Allow executing file as …

  2. What is the meaning of $? in a shell script? - Unix & Linux Stack …

    Feb 20, 2011 · This latter usage is faster, does not contaminate the shell's variable namespace with what amounts to temp variables, can often be a lot more readable for humans and encourages the …

  3. How can I pass a command line argument into a shell script?

    Feb 10, 2012 · The shell command and any arguments to that command appear as numbered shell variables: $0 has the string value of the command itself, something like script, ./script, …

  4. bash - How do I add environment variables? - Ask Ubuntu

    Aug 27, 2011 · The variable will be set for the rest of the shell session or until unset. To set an environment variable everytime, use the export command in the .bashrc file (or the appropriate …

  5. Linux Bash Shell Script Error: cannot execute: required file not found

    Oct 21, 2022 · To solve this, convert your script from a DOS text file to a Unix text file. If you are editing scripts on Windows, you can probably do this by configuring the Windows text editor to create Unix …

  6. Shell scripting: -z and -n options with if - Unix & Linux Stack Exchange

    Jan 20, 2025 · Shell scripting: -z and -n options with if Ask Question Asked 12 years, 1 month ago Modified 1 year ago

  7. How do I create a script file for terminal commands?

    To run a shell script, you need to make the file executable, which you can do with chmod +x <filename> In Linux, the current directory is not searched for a program, so you need to run ./<filename>, not …

  8. In a bash script, using the conditional "or" in an "if" statement

    In a bash script, using the conditional "or" in an "if" statement Ask Question Asked 13 years, 5 months ago Modified 1 year, 2 months ago

  9. How can I create a select menu in a shell script? - Ask Ubuntu

    I'm creating a simple bash script and I want to create a select menu in it, like this: $./script echo "Choose your option:" 1) Option 1 2) Option 2 3) Option 3 4) Quit And according to u...

  10. What does ampersand mean at the end of a shell script line?

    If the script starts with a shebang line (#!/bin/sh or similar), you can make it executable with chmod +x sys-snap.sh and start it directly by using ./sys-snap.sh if it is in the current directory. With & the …