Questions tagged as 'shell-script'

1
answer

String Return for Array

I'm doing a shellscript and got the command that returns: $ sqlite3 banco.db 'select code from channels' 00 01 02 03 When I assign the return to a variable, everything changes to a single string. $ export LISTA=$(sqlite3 banco.db 'sele...
asked by 06.11.2018 / 12:35
1
answer

Failed to get about: googleapi: Error 401: Invalid Credentials, authError

I'm using a generic Linux application for Google Drive, which aims to upload local folders to Google Drive via Shell Script. However, when trying to execute command in the terminal of Debian:    ./ gdrive about The application returns...
asked by 04.11.2018 / 01:29
2
answers

I can not change the value I want from a file through a ShellScript

88020:Maria Aguiar:EIB2:914256321:[email protected]:carro:Mercedes:1414-TX-13:13:14:4 83605:Tiago Domingues:ETA4:934442913:[email protected]:carro:BMW:14-TD-16:1:130:200 I have this code in a file, named condutores.txt . And in the script I...
asked by 03.11.2018 / 16:39
0
answers

Syntax Error

I'm trying to run one shell in parallel with another: # Consulta de Artefato def awsArti = "AWS_ACCESS_KEY_ID=${awsAccess} AWS_SECRET_ACCESS_KEY=${awsSecret} aws s3 ls ${awsRepo}hive-backend-messaging | cut -c 32-" # Shell (Obs. Estou tentand...
asked by 11.11.2018 / 14:54
0
answers

Sort files in shell

I'm a beginner in programming and I'm stuck in a code here. Through the shell I have to search within directories and sub directories all files that are of the form .py and have the datetime library included. And after that I ha...
asked by 10.10.2018 / 17:31
0
answers

PHP - Exec function, shell_exec, and system do not work correctly

Running the example documentation on the site itself works. Examples: echo exec('whoami'); $output = shell_exec('ls -l'); echo "<pre>$output</pre>"; My code does not differ so much from the examples described in the docume...
asked by 19.09.2018 / 22:12
0
answers

Sequential files in shell script

Good morning, I have the following problem: I have many files of the format somehow_X_YZ.txt, YZ represents a sequence of days. I want to know how I can check if in a particular folder, with these files that vary YZ, if they are all present...
asked by 12.09.2018 / 16:49
0
answers

List print server printers installed from a remote station

Work in a company that has the following structure: Each city in my state has a head office with a server that is also a print server, the printers are located here. I use the Systernals psexec together with a command to install the printe...
asked by 06.09.2018 / 20:15
1
answer

Vector size in a JSON in Shell Script

I'd like to get the size of a vector in a JSON in the scriipt shell but I'm only getting the size of each vector string, ie for the example: #!/bin/bash j='{"Nomes": { "nome": ["maria", "jose", "vitor","caio"] }}' echo $j echo $j | jq -r "....
asked by 07.09.2018 / 22:17
0
answers

Linux Copy file giving replace in content

How could it be done for me to copy via a shell script a php file, but replacing the contents of a variable? Example: cat config-sample.php > config.php <?php $senha="[dados_a_ser_substituido]";?>     
asked by 17.08.2018 / 22:27