Quantcast
Channel: Active questions tagged bash - DevOps Stack Exchange
Browsing all 56 articles
Browse latest View live

Automating the creation of an Apache virtual-host file specifically

When I create new web applications on my up-2-date Ubuntu-LAMP with Apache 2.4.x environment, I create their virtual-host files this...

View Article


How can I diagnose php cli command execution time inside a docker container

I've recently migrated an event subscription service called by a bash script from Ubuntu, into a Dockerised container.The Docker image I am using is: FROM php:7.1-apacheThe script itself is pretty...

View Article


Running consul in the background using Chef

I am trying to create a Chef cookbook that will run Hashicorp Consul in the background and will continue with the rest of the recipe and not get hung on starting Consul.I have tried the & method at...

View Article

Bash Tokenization Errors on Jenkins JNLP Slave

Why might the below bash commands give me an error on a Jenkins JNLP slave in Kubernetes cluster? Each work on a local machine.Error:Syntax error: redirection unexpectedIFS='/' read -r -a branch...

View Article

shell script to pass values properties file in java

I have a properties file that looks like this:mysql.username=USERNAMEmysql.pass=PASSI need to change USERNAME and PASS with variable values passed to shell script. I cannot use sed since that will work...

View Article


replacing values in shell script using sed [closed]

My shell script looks like this:FAILED_REQUEST_DIRECTORY=/bla/bla2 \java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1234 \ -jar /xyz/abc-service-1.0-SNAPSHOT.jar \ --server.port=1111...

View Article

Automatically write new bash history to change-log file

Every time I ssh into a server I might issue some bash commands and then sign off (hup signal?). Is there a way to write the shell commands that I issued on the server to some changelog file?I want to...

View Article

How to launch a docker container from within a GitLab Shell runner? [closed]

SituationMy CI pipeline needs to do the following:log into a VM and have access to a bash terminalrun a bash script that launches a Docker container with parameters (e.g. -it mode or providing the IP...

View Article


npm not found but installed from the shell script file in Dockerfile

I have a following Dockerfile:FROM ubuntu:18.04RUN mkdir app && cd appWORKDIR app/RUN apt-get update && apt-get install -y \ software-properties-common \ curl \ sudo \&& curl -O...

View Article


Add mapping ip and host into /etc/hosts with docker

I am using docker to scale my service.I know there's a command called --add--host for adding host into /etc/hostHowever, I have a bunch of hosts need to be added. It's just too long to launch a docker...

View Article

How to pass Gitlab env var with sensitive characters to bash script?

I have the following situation:I'm storing sensitive data in Gitlab's environment and then passing these variables to a deployment script in bash.Gitlab's env var:Key: sensitive_varValue: aaa$bbb*%Then...

View Article

echo colon to file in cloud-init [closed]

So, I have this part in my cloud-init:runcmd: - echo : RSA 'node.crt'>> /etc/ipsec.secretsI literally can't make it to work. I tried these variations:runcmd: - echo : RSA 'node.crt'>>...

View Article

Is \u the only way to output the user from .bashrc?

I can't get it to work on my Mac (catalina version 10.15.2).\u works on ubuntu when I test it but not on my Mac. I want to customize my mac terminal. Colors work fine on my Mac and it's reading the...

View Article


How do I add my IP address to the start of my terminal using the bashrc file?

I want to customise my terminal on an Amazon linux device. I have colours using $(tput setaf 33);, user name with /u but the IP address not there.#blue=$(tput setaf 33);PS1="\[${blue}]\u$(tput...

View Article

Interference of Docker CMD with su: works with su-exec but not with su?

In this bash script under Linux Alpine they have (line 8):exec su-exec "$ZOO_USER""$0""$@"As far as I know, su-exec is however an Apache httpd dependecy - can I avoid it installing it under Ubuntu and...

View Article


Exit a Makefile target called by parent without throwing an error

Let's say that I have 2 targets:test: # ... @$(MAKE) dosomething @echo test # ...dosomething: # ... @if [ -z "$(SOMETHING)" ]; then exit 0; fi @echo dosomething # ...I would like echo test to execute...

View Article

SSH connection to jenkins server

I have a absh script which connects and exexutes programs from my local to remote server and now this should be executed from jenkins build so for this jenkins is taking continous changes from git for...

View Article


Defining and using bash functions in AWS CodeBuild

I thought I could slightly improve readability of repetitive sed calls when inserting secrets into a file with AWS CodeBuild. I defined a bash function:replaceConfig() { sed -i 's|{'$1'}|'${!1}'|'...

View Article

How can I use bash functions in makefile?

If I need to use something like NVM in my makefile, I run into a problem, because NVM exports some bash functions that are not available in Make, even if my shell is defined as bash in the makefile.How...

View Article

How to create a "silent" MySQL docker container?

How can I create a MySQL docker container as below in the background:root:~# root:~# docker run -e MYSQL_ROOT_PASSWORD=pass --name sql-db -p 3306:3306 mysql &[1] 137878root:~# 2020-09-01...

View Article
Browsing all 56 articles
Browse latest View live


Latest Images