Questions tagged as 'bash'

0
answers

JQ - Read multiple arrays with bash

Edit: I was looking for other methods to treat Json and I ended up with [x["_source"]["'$1'"] for x in obj["hits"]["hits"]]: - I was curious and I was testing ... It worked beauty adding jq '.files['$X'].projectID' Good. I'm dev...
asked by 20.08.2018 / 22:52
2
answers

Run terminal from Python program

I am doing a distributed systems job, in which I am using PYRO, in it I am using objeto.adapter.rebindURI() to use the same object when the server that was (downed) is "restarted" ... I want this restart to be from my Python program...
asked by 21.05.2018 / 16:41
0
answers

How can I call a program.py on a server within another local program.py?

I have interacted with a server within a program that I am doing using the os.system () function as if it were using the console itself. os.system("ssh [email protected] 'comando a ser realizado'") For everything I had done before (create...
asked by 14.05.2018 / 22:20
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
1
answer

cPanel backup script moving files to wrong folder

I have this cPanel full backup script that works fine: ( link ). p> I followed exactly the orientation settings, I created two folders /backups/backup_daily and /backups/backup_monthly and the corresponding cron jobs. The pro...
asked by 06.05.2018 / 03:38
2
answers

Regular expression for URLs with dynamic media

I have an html file with urls in this default URL: https://www.olympikus.com.br/tenis-olympikus-flower-415-feminino-cinza-D22-1131-010 The default is protocolo://dominio/strig-dinâmica-000-0000-000 I want to get all the links in...
asked by 28.04.2018 / 23:42
0
answers

Shell script extract extension and search only by name

Can anyone fix my script? The purpose of the script is to compare the input files with the files in the WASTE folder, the problem is that if the input file is teste1.txt it does not find the file teste1.tar.bz2 p> #!/bin/bash...
asked by 23.03.2018 / 14:17
1
answer

Extract substring from a line in bash with a pattern

Good afternoon everyone, I have a text file with several rows with fixed columns: 11Sala 1:4 FF The first column has the ID, and the second one has the data I want to get ( 1:4 ), but when I...
asked by 16.03.2018 / 14:11
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
1
answer

How to clone a repository in Bitbucket using a bash code and pass the password as a parameter?

I have a bash code that creates an instance of a server in AWS. The last step of this process is to make the project clone that is in bitbucket.org . Normally what I do manually are these steps: cd $HOME/vhosts - I position...
asked by 14.01.2018 / 16:17