About 476,000 results
Open links in new tab
  1. 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 …

  2. 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, …

  3. What does $# mean in shell? - Unix & Linux Stack Exchange

    What does $# mean in shell? I have code such as if [ $# -eq 0 ] then I want to understand what $# means, but Google search is very bad for searching these kinds of things.

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

    Jan 16, 2014 · Shell scripting: -z and -n options with if Ask Question Asked 11 years, 10 months ago Modified 10 months ago

  5. How to make a file (e.g. a .sh script) executable, so it can be run ...

    Dec 16, 2012 · The OP asked "how to make script.sh executable. While you can do that, the original intent of the .sh suffix was to allow you to have a "source" and and "object" file.

  6. shell - Bash - Unix & Linux Stack Exchange

    Shell scripts will run each command sequentially, waiting for the first to finish before the next one starts. You can either join commands with ; or have them on separate lines:

  7. 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, 3 months ago Modified 1 year ago

  8. How can I assign the output of a command to a shell variable?

    A shell assignment is a single word, with no space after the equal sign. So what you wrote assigns an empty value to thefile; furthermore, since the assignment is grouped with a command, it makes …

  9. Current time/date as a variable in BASH and stopping a program with a ...

    Mar 5, 2018 · Related things: About backticks in command substitutions: Have backticks (i.e. `cmd`) in *sh shells been deprecated? About quoting variable expansions: Security implications of forgetting to …

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