About 454,000 results
Open links in new tab
  1. Linux Bash Script, Single Command But Multiple Lines?

    Linux Bash Script, Single Command But Multiple Lines? Ask Question Asked 12 years, 11 months ago Modified 2 years, 6 months ago

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

    Aug 27, 2011 · To set an environment variable from a script, use the export command in the script, and then source the script. If you execute the script it will not work. For an explanation …

  3. How to increment a variable in bash? - Ask Ubuntu

    Jan 30, 2017 · I found that on Bash 3.2.57, using declare -i x and then doing x+=1 in a loop (doing other thing), x did not increment more than one time. The let and (()) methods worked fine.

  4. How to activate python virtualenv through shell script?

    Apr 30, 2020 · The same thing I am trying to achieve I have to run this command source .venv/bin/activate through a bash script which is not running, as I need the env should get …

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

  6. Run part of a bash script as a different user

    Nov 28, 2023 · I am in Ubuntu 9.04. Is there a way to make part of a script run as a different (non-root) user? If it helps, the part to be run as a different user occurs at the end of the script.

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

    Dec 16, 2012 · The bash command is actually store as /bin/bash and it is an executable on all Ubuntu systems. Creating a file of commands saves you from adding the shebang #!/bin/bash …

  8. bash - How to run an alias in a shell script? - Ask Ubuntu

    Sourcing a script with the . or source buiiltin causes the current shell to execute all the commands in it. If alias expansion would occur in the shell in which . or source is run, it occurs.

  9. Automatically enter input in command line - Ask Ubuntu

    Aug 29, 2013 · 4 You can supply user input to your script with cat, from a text file, piped to your script with bash like this: cat input.txt | bash your_script.sh Just put your desired user input into …

  10. What is the meaning of exit 0, exit 1, and exit 2 in a bash script?

    Mar 14, 2017 · A bash script is like a movie theater, there are different exists. The exit statements mark the location of the exits for the bash interpreter. When the script is fired, the interpreter is …