About 478,000 results
Open links in new tab
  1. Shell scripting: -z and -n options with if - Unix & Linux Stack …

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

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

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

  5. What does -f mean in an if statement in a bash script?

    Jul 5, 2018 · The relevant man page to check for this is that of the shell itself, bash, because -f is functionality that the shell provides, it's a bash built-in. On my system (CentOS 7), the fine …

  6. 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, 2 months ago Modified 12 months ago

  7. bash - How to get execution time of a script effectively? - Unix ...

    Jan 26, 2017 · I would like to display the completion time of a script. What I currently do is - #!/bin/bash date ## echo the date at start # the script contents date ## echo the date at end …

  8. BASH script to set environment variables not working

    Your command-line environment is the parent of the script's shell, so it does not see the variable assignment. You can use the . (or source) bash command to execute the script commands in …

  9. Passing named arguments to shell scripts - Unix & Linux Stack …

    $ ./my_script -p '/some/path' -a5 Argument p_out is /some/path Argument arg_1 is 5 There is a helpful Small getopts tutorial or you can type help getopts at the shell prompt. Edit: The …

  10. bash - Killing a shell script running in background - Unix & Linux ...

    Dec 13, 2014 · I have written a shell script to monitor a directory using the inotifywait utility of inotifyt-tools. I want that script to run continuously in the background, but I also want to be able …