# \#bash

**URL:** https://discuss.circleci.com/tag/bash/185.md

[Latest](https://discuss.circleci.com/latest.md) · [Categories](https://discuss.circleci.com/categories.md) · [Tags](https://discuss.circleci.com/tags.md)

---

## [I can not get the stdout from a bash script](https://discuss.circleci.com/t/i-can-not-get-the-stdout-from-a-bash-script/48251)

<div class="topic-metadata">

**Author:** [@Tolosa527](https://discuss.circleci.com/u/Tolosa527)\
**Replies:** 0\
**Last updated:** [June 2, 2023, 12:43pm UTC](https://discuss.circleci.com/t/i-can-not-get-the-stdout-from-a-bash-script/48251 "2023-06-02T12:43:31Z")

</div>

Hello community! I am trying to find out how can I see the stdout or stderr from a bash script. I created a bash script, and I ran it in the following way: - run: name: Backend server health check c…

---

## [Disable rvm when using set -xv in shell script](https://discuss.circleci.com/t/disable-rvm-when-using-set-xv-in-shell-script/45311)

<div class="topic-metadata">

**Author:** [@evilensky](https://discuss.circleci.com/u/evilensky)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 2:21pm UTC](https://discuss.circleci.com/t/disable-rvm-when-using-set-xv-in-shell-script/45311 "2023-03-31T14:21:35Z")

</div>

When we use set -xv to debug a shell script, for every single command we get the entire execution path of utilities like rvm. It repeats for every single command in our script :slight\_smile: What is a good way to avoid…

---

## [How to use variables from a bash script within a CircleCI config?](https://discuss.circleci.com/t/how-to-use-variables-from-a-bash-script-within-a-circleci-config/46789)

<div class="topic-metadata">

**Author:** [@paarth1995](https://discuss.circleci.com/u/paarth1995)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 5:32am UTC](https://discuss.circleci.com/t/how-to-use-variables-from-a-bash-script-within-a-circleci-config/46789 "2023-01-20T05:32:19Z")

</div>

Hello, I have a bash script that looks like this :- #!/bin/bash #!/bin/bash username=${CIRCLE\_USERNAME} stage=$(echo "${username}" | sed 's/\[^a-zA-Z\]//g' | tr "\[:upper:\]" "\[:lower:\]") echo "${stage}" and i want to us…

---

## [Cp doesn't overwrite files when executed on CircleCI](https://discuss.circleci.com/t/cp-doesnt-overwrite-files-when-executed-on-circleci/42535)

<div class="topic-metadata">

**Author:** [@AntonioRedondo](https://discuss.circleci.com/u/AntonioRedondo)\
**Replies:** 2\
**Last updated:** [October 26, 2022, 9:09pm UTC](https://discuss.circleci.com/t/cp-doesnt-overwrite-files-when-executed-on-circleci/42535 "2022-10-26T21:09:05Z")

</div>

From my .circle/config.yml file I have a run statement like this: pre-steps: - run: command: cp .env.dev .env On the file system where this command is executed on CircleCI servers there is an existing .env file, …

---

## [Cannot execute multiple shell scripts in a row](https://discuss.circleci.com/t/cannot-execute-multiple-shell-scripts-in-a-row/44984)

<div class="topic-metadata">

**Author:** [@jakub-przybylowicz](https://discuss.circleci.com/u/jakub-przybylowicz)\
**Replies:** 3\
**Last updated:** [August 18, 2022, 1:11pm UTC](https://discuss.circleci.com/t/cannot-execute-multiple-shell-scripts-in-a-row/44984 "2022-08-18T13:11:13Z")

</div>

Hello all, I’ve run into a problem while building a new workflow. Here’s the premises and the issue: I’m building a workflow which automates the code release process It’s based on a couple of steps - for creating a r…

---

## [Npm ERR! enoent ENOENT: no such file or directory, open '/usr/app/package.json' CI error but works locally](https://discuss.circleci.com/t/npm-err-enoent-enoent-no-such-file-or-directory-open-usr-app-package-json-ci-error-but-works-locally/44580)

<div class="topic-metadata">

**Author:** [@mohamedgamalali](https://discuss.circleci.com/u/mohamedgamalali)\
**Replies:** 4\
**Last updated:** [June 30, 2022, 10:47am UTC](https://discuss.circleci.com/t/npm-err-enoent-enoent-no-such-file-or-directory-open-usr-app-package-json-ci-error-but-works-locally/44580 "2022-06-30T10:47:52Z")

</div>

as you see i’m already wrote COPY package\*.json /usr/app/ when i’m try to run docker-compose run bona\_api ls it only returns node\_modules Dockerfile: FROM node:16.3.0-alpine WORKDIR /usr/app COPY package\*.json /usr/ap…

---

## [Not copied hidden files on local build by circleci cli](https://discuss.circleci.com/t/not-copied-hidden-files-on-local-build-by-circleci-cli/14307)

<div class="topic-metadata">

**Author:** [@inoutch](https://discuss.circleci.com/u/inoutch)\
**Replies:** 31\
**Last updated:** [January 21, 2022, 9:26am UTC](https://discuss.circleci.com/t/not-copied-hidden-files-on-local-build-by-circleci-cli/14307 "2022-01-21T09:26:03Z")

</div>

It has not been copied .\* files of the project by cp command in checkout phase of local build. I need copying hidden files like .babelrc to build successfully. Suspicious log: ====\>\> Checkout code #!/bin/sh …

---

## [Difference behavior when using SSH through CircleCi Workflow](https://discuss.circleci.com/t/difference-behavior-when-using-ssh-through-circleci-workflow/42392)

<div class="topic-metadata">

**Author:** [@AreebRoyepen](https://discuss.circleci.com/u/AreebRoyepen)\
**Replies:** 1\
**Last updated:** [December 28, 2021, 3:32pm UTC](https://discuss.circleci.com/t/difference-behavior-when-using-ssh-through-circleci-workflow/42392 "2021-12-28T15:32:30Z")

</div>

Hi all, (Im new to CircleCi and Im not sure if this is the correct place for this question) I have a SpringBoot RestAPI (v2.2.6.RELEASE) pointing to a MySql database. Below is an extract of the properties file: sprin…

---

## [Attach to docker container that is started when using CircleCI Local CLI](https://discuss.circleci.com/t/attach-to-docker-container-that-is-started-when-using-circleci-local-cli/41223)

<div class="topic-metadata">

**Author:** [@roxlu](https://discuss.circleci.com/u/roxlu)\
**Replies:** 1\
**Last updated:** [September 16, 2021, 8:30pm UTC](https://discuss.circleci.com/t/attach-to-docker-container-that-is-started-when-using-circleci-local-cli/41223 "2021-09-16T20:30:31Z")

</div>

I’m using the circleci tool to locally test my circleci configs and I’m wondering if it’s possible to attach to the docker container that’s started after executing circleci local execute -c process.yml . I’m building a …

---

## [Problem using CIRCLE\_NODE\_INDEX to split tests](https://discuss.circleci.com/t/problem-using-circle-node-index-to-split-tests/41112)

<div class="topic-metadata">

**Author:** [@TimJonsson](https://discuss.circleci.com/u/TimJonsson)\
**Replies:** 0\
**Last updated:** [September 2, 2021, 5:56am UTC](https://discuss.circleci.com/t/problem-using-circle-node-index-to-split-tests/41112 "2021-09-02T05:56:08Z")

</div>

Hello I’m having trouble splitting my unit tests through the env var CIRCLE\_NODE\_INDEX following this documentation. When running unit tests on one container (parallelism: 1) my test run in about 7 minutes. When I’m do…

---

## [Bash On Windows Image Defaults to Wrong Sort Command](https://discuss.circleci.com/t/bash-on-windows-image-defaults-to-wrong-sort-command/40218)

<div class="topic-metadata">

**Author:** [@Kurt-von-Laven](https://discuss.circleci.com/u/Kurt-von-Laven)\
**Replies:** 0\
**Last updated:** [May 29, 2021, 3:41am UTC](https://discuss.circleci.com/t/bash-on-windows-image-defaults-to-wrong-sort-command/40218 "2021-05-29T03:41:58Z")

</div>

When you use the run command with the bash.exe shell from windows@2.4.0 using the windows/default executor, sort incorrectly runs the C:\\\\Windows\\System32\\sort command rather than the GNU /usr/bin/sort as you may verify …

---

## [Example bash script to get job artifacts from pipeline](https://discuss.circleci.com/t/example-bash-script-to-get-job-artifacts-from-pipeline/36795)

<div class="topic-metadata">

**Author:** [@nbialostosky](https://discuss.circleci.com/u/nbialostosky)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 1:36pm UTC](https://discuss.circleci.com/t/example-bash-script-to-get-job-artifacts-from-pipeline/36795 "2020-08-04T13:36:16Z")

</div>

Hi There! Recently the Support team created a script for easily getting artifacts from a pipeline. This was created since the artifacts are associated with the jobs in the pipeline, it requires finding the jobs and retu…

---

## [CIMG: Using \`exit\` in bash login shells always fails the step](https://discuss.circleci.com/t/cimg-using-exit-in-bash-login-shells-always-fails-the-step/35380)

<div class="topic-metadata">

**Author:** [@PhilLavoie](https://discuss.circleci.com/u/PhilLavoie)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 6:43pm UTC](https://discuss.circleci.com/t/cimg-using-exit-in-bash-login-shells-always-fails-the-step/35380 "2020-04-09T18:43:53Z")

</div>

In the below configuration, we simply test running “exit 0” under 2 shells. The default linux shell and one with the login option added “-l”. version: 2.1 workflows: test\_exit: jobs: - test\_non\_login …

---

## [Use bash env with env variables](https://discuss.circleci.com/t/use-bash-env-with-env-variables/33876)

<div class="topic-metadata">

**Author:** [@juancarlosjr97](https://discuss.circleci.com/u/juancarlosjr97)\
**Replies:** 1\
**Last updated:** [December 24, 2019, 5:12pm UTC](https://discuss.circleci.com/t/use-bash-env-with-env-variables/33876 "2019-12-24T17:12:52Z")

</div>

Hello, I am trying to use a CircleCI configuration with two different environments, master and production which are two different servers. I have created my env variables in the configuration of the project, and I can i…

---

## [Released Xcode 11.2 and macOS 10.15 (Catalina)](https://discuss.circleci.com/t/released-xcode-11-2-and-macos-10-15-catalina/33302)

<div class="topic-metadata">

**Author:** [@marc](https://discuss.circleci.com/u/marc)\
**Replies:** 15\
**Last updated:** [November 12, 2019, 10:32am UTC](https://discuss.circleci.com/t/released-xcode-11-2-and-macos-10-15-catalina/33302 "2019-11-12T10:32:36Z")

</div>

We have released Xcode 11.2, which will replace the beta release. The new image contains Xcode 11.2, running on Catalina. You can select this image by selecting 11.2.0 as follows: jobs: build: macos: xcode…

---

## [How to use a $BASH\_ENV variable as a parameter to a command or when condition](https://discuss.circleci.com/t/how-to-use-a-bash-env-variable-as-a-parameter-to-a-command-or-when-condition/29186)

<div class="topic-metadata">

**Author:** [@excenter](https://discuss.circleci.com/u/excenter)\
**Replies:** 2\
**Last updated:** [March 22, 2019, 3:05pm UTC](https://discuss.circleci.com/t/how-to-use-a-bash-env-variable-as-a-parameter-to-a-command-or-when-condition/29186 "2019-03-22T15:05:39Z")

</div>

I have a variable determined by a bash script that stores a variable in $BASH\_ENV. I need to use this variable when passing a parameter to a command. I can pull parameters into variables with \<\< parameters.repository-i…

---

## [Unexpected exit codes after explicit exit 1 / 0](https://discuss.circleci.com/t/unexpected-exit-codes-after-explicit-exit-1-0/27716)

<div class="topic-metadata">

**Author:** [@sabau](https://discuss.circleci.com/u/sabau)\
**Replies:** 1\
**Last updated:** [January 21, 2019, 10:43am UTC](https://discuss.circleci.com/t/unexpected-exit-codes-after-explicit-exit-1-0/27716 "2019-01-21T10:43:52Z")

</div>

Hi all, I’m setting up sa quick check to avoid being able to push unsafe dependencies. We are using yarn and updating it right before, I tried to run the same commands ssh-ing into the failed job and they seems to work …

---

## [How to make 3-4 commits to launch different type of automated UI tests in CircleCI?](https://discuss.circleci.com/t/how-to-make-3-4-commits-to-launch-different-type-of-automated-ui-tests-in-circleci/27466)

<div class="topic-metadata">

**Author:** [@artur-abd](https://discuss.circleci.com/u/artur-abd)\
**Replies:** 8\
**Last updated:** [January 16, 2019, 9:22pm UTC](https://discuss.circleci.com/t/how-to-make-3-4-commits-to-launch-different-type-of-automated-ui-tests-in-circleci/27466 "2019-01-16T21:22:35Z")

</div>

Before it was working for regression and sanity tests: Inside config.yml file: - run: if (git log --format=%B -n 1 $CIRCLE\_SHA1) | grep -iqF release; then cd \<company\_folder\> && mvn clean && mvn test -e -X -Dwebdriver.…

---

## [Exposing Environment Variables to subsequent processes](https://discuss.circleci.com/t/exposing-environment-variables-to-subsequent-processes/27588)

<div class="topic-metadata">

**Author:** [@gDelgado14](https://discuss.circleci.com/u/gDelgado14)\
**Replies:** 1\
**Last updated:** [January 13, 2019, 2:48pm UTC](https://discuss.circleci.com/t/exposing-environment-variables-to-subsequent-processes/27588 "2019-01-13T14:48:23Z")

</div>

Hey everyone, I’m trying to create a deploy pipeline for my project. All code is available here: Everything works fine in the .circleci/config.yml file. The issue is within the deploy/run.sh script that I run in the …

---

## [Failed Build: Exit Code 141](https://discuss.circleci.com/t/failed-build-exit-code-141/26335)

<div class="topic-metadata">

**Author:** [@mikemfleming](https://discuss.circleci.com/u/mikemfleming)\
**Replies:** 2\
**Last updated:** [November 26, 2018, 7:08pm UTC](https://discuss.circleci.com/t/failed-build-exit-code-141/26335 "2018-11-26T19:08:23Z")

</div>

I am using a script that pipes yes to a command. When that command exits, yes is still writing input but the command isn’t listening, so it throws an error (Exit Code 141) despite my command exiting successfully and it a…

---

## [API to build not returning all error messages](https://discuss.circleci.com/t/api-to-build-not-returning-all-error-messages/24583)

<div class="topic-metadata">

**Author:** [@mikeschinkel](https://discuss.circleci.com/u/mikeschinkel)\
**Replies:** 0\
**Last updated:** [August 23, 2018, 2:24pm UTC](https://discuss.circleci.com/t/api-to-build-not-returning-all-error-messages/24583 "2018-08-23T14:24:35Z")

</div>

I have set up a script for local builds as described in the 2.0 docs here: https://circleci.com/docs/2.0/examples/#video-test-your-config-file-locally I have pasted in the script below. Unfortunately the JSON returne…

---

## [Creating custom spinners](https://discuss.circleci.com/t/creating-custom-spinners/23754)

<div class="topic-metadata">

**Author:** [@philophilo](https://discuss.circleci.com/u/philophilo)\
**Replies:** 0\
**Last updated:** [July 22, 2018, 7:15pm UTC](https://discuss.circleci.com/t/creating-custom-spinners/23754 "2018-07-22T19:15:49Z")

</div>

Is it possible to create a custom spinner? I have the following in a script #!/bin/bash show\_spinner() { local -r pid="${1}" local -r delay='0.3' local spinstr='\\|/-' local temp while ps a | awk '{print $1}' …

---

## ["Build output is too large..." due to capturing \`pip install ...\` progress](https://discuss.circleci.com/t/build-output-is-too-large-due-to-capturing-pip-install-progress/21029)

<div class="topic-metadata">

**Author:** [@nnadeau](https://discuss.circleci.com/u/nnadeau)\
**Replies:** 4\
**Last updated:** [March 25, 2018, 1:34pm UTC](https://discuss.circleci.com/t/build-output-is-too-large-due-to-capturing-pip-install-progress/21029 "2018-03-25T13:34:58Z")

</div>

Example build: https://circleci.com/gh/nnadeau/pybotics/529 Example log verbosity, below: Python 3.6.1 Collecting numpy\>=1.9.0 (from -r requirements.txt (line 1)) Downloading numpy-1.14.2-cp36-cp36m-manylinux1\_x86\_6…

---

## [A simple deployment used to work but not anymore](https://discuss.circleci.com/t/a-simple-deployment-used-to-work-but-not-anymore/20743)

<div class="topic-metadata">

**Author:** [@jvicensfarrus](https://discuss.circleci.com/u/jvicensfarrus)\
**Replies:** 1\
**Last updated:** [March 16, 2018, 9:30am UTC](https://discuss.circleci.com/t/a-simple-deployment-used-to-work-but-not-anymore/20743 "2018-03-16T09:30:31Z")

</div>

Hi! I’m trying to use CircleCI to deploy a project into different branches. I got it work at my first test, but now with the real project and its propers files, I don’t know why, is not working anymore and I don’t get an…

---

## [Parallel runs status](https://discuss.circleci.com/t/parallel-runs-status/15876)

<div class="topic-metadata">

**Author:** [@jobwat](https://discuss.circleci.com/u/jobwat)\
**Replies:** 3\
**Last updated:** [February 26, 2018, 5:16am UTC](https://discuss.circleci.com/t/parallel-runs-status/15876 "2018-02-26T05:16:28Z")

</div>

Hi, Is there a way to gather the return code of the parallel runs ? I'm willing to control the results of multiple tests ran in parallel I want a secondary, non-parallel script, to do it Something like that: test…

---

## [Unwanted output in the test output](https://discuss.circleci.com/t/unwanted-output-in-the-test-output/18744)

<div class="topic-metadata">

**Author:** [@afilina](https://discuss.circleci.com/u/afilina)\
**Replies:** 1\
**Last updated:** [December 23, 2017, 11:57pm UTC](https://discuss.circleci.com/t/unwanted-output-in-the-test-output/18744 "2017-12-23T23:57:04Z")

</div>

I’m suppressing all curl output from my deployment script, but this just keeps popping when I curl to a 404: \[Fri Dec 8 04:32:33 2017\] 127.0.0.1:58728 \[404\]: / This is intended behavior in my script and this output po…

---

## [Suddenly getting a bash warning about setLocal](https://discuss.circleci.com/t/suddenly-getting-a-bash-warning-about-setlocal/18271)

<div class="topic-metadata">

**Author:** [@benjamincharity](https://discuss.circleci.com/u/benjamincharity)\
**Replies:** 0\
**Last updated:** [November 21, 2017, 2:12pm UTC](https://discuss.circleci.com/t/suddenly-getting-a-bash-warning-about-setlocal/18271 "2017-11-21T14:12:23Z")

</div>

I’ve started seeing this warning: /bin/bash: warning: setlocale: LC\_ALL: cannot change locale (en\_US.UTF-8) Anyone know the meaning or why I’m suddenly seeing this?

---

## [Specify docker tag via environment variable](https://discuss.circleci.com/t/specify-docker-tag-via-environment-variable/17265)

<div class="topic-metadata">

**Author:** [@MrMan](https://discuss.circleci.com/u/MrMan)\
**Replies:** 2\
**Last updated:** [October 11, 2017, 12:23pm UTC](https://discuss.circleci.com/t/specify-docker-tag-via-environment-variable/17265 "2017-10-11T12:23:05Z")

</div>

I would like to use an environment variable to specify a docker image tag: job\_name: docker: - image: example/example-docker:${BRANCH} ... This environment variable can be created in a previous job and will…

---

## [Get list of commits in build](https://discuss.circleci.com/t/get-list-of-commits-in-build/15725)

<div class="topic-metadata">

**Author:** [@adri](https://discuss.circleci.com/u/adri)\
**Replies:** 1\
**Last updated:** [September 28, 2017, 3:36pm UTC](https://discuss.circleci.com/t/get-list-of-commits-in-build/15725 "2017-09-28T15:36:46Z")

</div>

For every build I see at the top the new commits that were added. Is there a way to get a reference to the commits via a git command? My goal is make a script to check if there were changes in a certain directory in a…

---

## [Can shell script](https://discuss.circleci.com/t/can-shell-script/16740)

<div class="topic-metadata">

**Author:** [@amalrik](https://discuss.circleci.com/u/amalrik)\
**Replies:** 2\
**Last updated:** [September 25, 2017, 4:22pm UTC](https://discuss.circleci.com/t/can-shell-script/16740 "2017-09-25T16:22:53Z")

</div>

Hello. I have a rails project on circleci, https://circleci.com/gh/brasilct/finder/47 but couldn't manage to make the build work. I keep getting this error: sudo: ./test/bin/install-freetds.sh: command not found My cir…

[Next page](https://discuss.circleci.com/tag/bash/185.md?match_all_tags=true&page=1&tags%5B%5D=bash)
