Questions tagged as 'bash'

2
answers

Concatenate rows in Linux file

I need to generate a linux script that concatenates information. I have a file (arch1.txt) that contains first and last names: Juan Perez Ana Lopez and I have another script that, when executed, returns a line that contains the age of the p...
asked by 17.03.2017 / 05:48
1
answer

problems with 'cat' in bash

I have a problem what I want is to use a cat to gather hundreds of files that I have in different folders that are for days, which in turn has sub-folders. The next line of code that what you have to do is put all the files that start...
asked by 02.02.2016 / 20:37
2
answers

SSH from a host with a user that is used by several people

Context I need to connect from a host (my machine) to a server2 to which I can only connect through a server1. The server1 has a single user (user1) to which we connect several people and from this I am already connected to the user that...
asked by 03.03.2018 / 21:01
2
answers

Restart Mysql before the maximum connections arrive

I have a MySQL DB running on a Debian machine in GCP, which sometimes reaches the limit of connections, which leaves the application stopped until it is restarted and then the application can be reconnected. Currently has a maximum number of...
asked by 12.12.2018 / 15:44
1
answer

How to perform date conversion YYYY-mm-dd in bash

How can I get the format of a specific date? I have the following date: 18APR01 but that format I do not want, The code that I have is the following: date --date=18APR01 +%Y-%m-%d Exit: 2001-04-18 What I really want is for the out...
asked by 19.10.2018 / 23:00
3
answers

How to use for cycle in bash script?

I have a little bash script that does not work the way I want to Here is the code #! /bin/bash echo "Escriba la cantidad de letras" read x for i in $x;do echo "Letra $i" read y echo $y done #export Mensaje #./recibir.sh Image of the log...
asked by 10.11.2016 / 21:45
1
answer

How to generate output with colors from shell script bash to file and maintain the colors?

I'm developing a utility in a bash shell script (file.sh), I can generate colors when the output goes to console, for example with a code like: echo -e "\e[1;33m Aqui el mensaje \e[0m"; But my idea is to create a log file as identical as po...
asked by 29.10.2018 / 18:27
2
answers

Execute bash script, from python, with script in the PATH

I have a folder with multiple scripts that I want to call from Python. I have added the folder to the PATH to be able to call these from any directory. And it has been added correctly: user@myuser:~ export PATH=$PATH:~/misScripts user@myus...
asked by 23.08.2018 / 13:54
1
answer

How to configure environment variable in heroku?

I found myself in need of setting environment variables in heroku for the deployment in production mode of my project. The variables were the credentials for accessing the data base const DB_HOST = process.env.DB_HOST || 'localhost';...
asked by 28.09.2018 / 06:17
1
answer

Subtract time in nanoseconds

I have a file.txt file with this: 15:31:16.481 15:31:09.215 15:31:09.211 15:31:00.019 15:30:59.593 15:30:53.246 15:31:21.244 15:31:17.646 19:17:51.124 19:17:49.691 19:17:48.296 19:17:36.297 19:17:57.565 19:17:51.449 14:48:...
asked by 16.10.2018 / 05:01