About 4,950,000 results
Open links in new tab
  1. How do I parse command line arguments in Bash? - Stack Overflow

    See also Giving a bash script the option to accepts flags, like a command? for an elaborate, ad hoc, long and short option parser. It does not attempt to handle option arguments attached to …

  2. How to write a bash script to set global environment variable?

    The strategy involves having a 'set' script which dynamically writes a 'load' script, which has code to set and export an environment variable. The 'load' script is then executed periodically by …

  3. bash - Shell equality operators (=, ==, -eq) - Stack Overflow

    529 = and == are for string comparisons -eq is for numeric comparisons -eq is in the same family as -lt, -le, -gt, -ge, and -ne == is specific to bash (not present in sh (Bourne shell), ...). Using …

  4. shell - Redirect stderr and stdout in Bash - Stack Overflow

    I want to redirect both standard output and standard error of a process to a single file. How do I do that in Bash?

  5. How do I execute a bash script in Terminal? - Stack Overflow

    Mar 9, 2018 · Use a shebang, which I see you have (#!/bin/bash) in your example. If you have that as the first line of your script, the system will use that program to execute the script.

  6. Loop through an array of strings in Bash? - Stack Overflow

    Jan 16, 2012 · I want to write a script that loops through 15 strings (array possibly?) Is that possible? for databaseName in listOfNames then # Do something end

  7. Bash Script : what does #!/bin/bash mean? - Stack Overflow

    Dec 14, 2012 · In bash script, what does #!/bin/bash at the 1st line mean ? In Linux system, we have shell which interprets our UNIX commands. Now there are a number of shell in Unix …

  8. How do I prompt a user for confirmation in bash script?

    Dec 11, 2009 · I want to put a quick "are you sure?" prompt for confirmation at the top of a potentially dangerous bash script, what's the easiest/best way to do this?

  9. bash - How can I check if a package is installed and install it if not ...

    Tested on Ubuntu 20.10. Python apt package There is a pre-installed Python 3 package called apt in Ubuntu 18.04 which exposes an Python apt interface! A script that checks if a package …

  10. How to source virtualenv activate in a Bash script

    Sourcing runs shell commands in your current shell. When you source inside of a script like you are doing above, you are affecting the environment for that script, but when the script exits, the …