Questions tagged as 'shell-script'

0
answers

While and if: Change the while and if checks for varieveis

I am creating a script for automating a process, however in the script I have to read a directory and insert the contents (filename) into a text file and while I read each line to process the files. The question is, do you have to do this same p...
asked by 21.08.2018 / 16:55
2
answers

set shell user to call script in rails

I need to call a shell script from rails, with a specific shell user. Example: update_response = '#{deploy_dir}/./update.sh' By default my system is using root. I would like to know, given this example, if you have how to specify the...
asked by 03.07.2018 / 15:35
0
answers

How to search for generic text / phrases in a certain language?

I have a hundred ".jade" files that have several phrases in Spanish in a static way. I want to map and exchange these phrases for dynamic content based only on the language type (since I do not have a previous content dictionary). What would be...
asked by 29.06.2018 / 22:04
1
answer

Output Redirection

comando | tee -a saida.txt How do I redirect only part of the output of a command?     
asked by 26.04.2018 / 20:25
0
answers

Terminate ssh remote connection

I have the following script that opens a remote connection on the terminal: xterm -e ssh -t user@IP -p porta "cd pasta && bash script.sh && exit ; bash" How can I make the connection to be terminated and close the terminal...
asked by 14.04.2018 / 18:52
1
answer

Handle special characters

I am trying to return the CURL with SED, but as the information I get but sometimes has the character / causes an error in the SED syntax. TOKEN=$(curl --silent $URL | awk -F '"' '/content/ {print $2}') echo $TOKEN 2CTVaTm46Uoregv0VcU2QPd1...
asked by 05.04.2018 / 16:08
1
answer

Treat curl return on Linux

I'm putting together a shellscript and sending a json file to a webservice, the return is as follows: {"success":false,"errorCode":3,"message":"Authenticity Token invalido"} I'm trying, using Linux shell commands, throwing false in one vari...
asked by 05.04.2018 / 14:09
0
answers

Shell Script to automate the installation of programs in Linux

I've put some commands in a simple Shell Script to automate the installation of web site hosting, the basics of the basic: #!/bin/bash # O Script será automaticamente finalizado se encontrar erros set -euo pipefail IFS=$'\n\t' # Ubuntu 16.04...
asked by 23.03.2018 / 00:29
1
answer

while read does not work in Unix shell script

I am programming a script and using while read twice it does 1 only once: un=$(echo $LOGNAME | tr '[A-Z]' '[a-z]') grep -v '^#' nodeteste.txt > auxiliar.txt while read line do ssh "$un@$line" "cat arquivo" > arquivo.externo cu...
asked by 13.02.2018 / 18:59
1
answer

My shell script does not work "word unexpected (expecting" in ")"

I have no experience with Shell Script, and I can not figure out what the problem is with my code. #!/bin/bash echo 'Deseja alterar a data e a hora deste computador (S/N) ?' read dataHoras if [$dataHoras == S or $dataHoras == s]; then...
asked by 22.02.2018 / 15:47