Questions tagged as 'bash'

1
answer

Bash, copy files from the server to the local disk

I'm trying to copy some files that I have on the server to the local disk through the following command scp [email protected]:media/lab7/Disk1/blast_out/*e0001_ssRNA_blast.out adrian@adrianuser:~/adrian/Documents/ but until now executin...
asked by 05.06.2018 / 16:06
1
answer

Adduser in Shellscript [duplicated]

I have to create a script that can receive up to two parameters: In case you receive 0 parameters the script has to show the login of all system users. In the case that it receives 1 parameter if parameter 1 is "-h" that shows a help or...
asked by 13.05.2018 / 15:30
1
answer

how can I select one of the 6 arrays at random? [closed]

#!/bin/bash _0=(Mami Bebe Princesa Mami) _1=("Yo quiero " "Yo puedo " "Yo vengo a " "Voy a ") _2=(Encenderte Amarte Ligar Jugar) _3=(Suave Lento Rapido Fuerte) _4=("Hasta que salga el sol " "Toda la noche " "Hasta el amanecer " "Todo...
asked by 29.10.2017 / 01:28
1
answer

Unexpected operator in bash [closed]

I'm doing a bash script to automatically configure the network. When I finished it I put it in link and it did not give me any mistakes. However, when I run the scritp I get an error on line 58. The error is this:    configred.sh: 58: [: ye...
asked by 07.05.2017 / 12:51
1
answer

Robocopy copy a folder with a certain name

I wanted to know if it is possible to copy the contents of a folder that contains a specific name, for example: Folder1 Sub1 Sub2 Carpeta2 Sub1 Sub2 I tried the following:    robocopy "C: \ source \" "C: \ destination \"...
asked by 16.08.2016 / 17:22
1
answer

The value of a variable is lost

I have a problem with a variable that I want to keep, but I suppose that by the memory reference that Bash does, he crushes me anyway. I have a function that I call with 3 parameters: MiFuncion "Correo sin leer" "[email protected]" "Este es el...
asked by 05.01.2019 / 14:11
0
answers

Check if all the files can be read by the current user

I am creating a script in Ubuntu and I can not make the script before checking the md5, it tells me if the files are accessible to the current user. The script must generate the md5 of directories or files, and I would like it before generati...
asked by 02.01.2019 / 09:16
1
answer

Bash "file.sh" error in if extracting cat output to a variable and comparing it in if

When extracting the variable, everything is correct, but it does not compare it to me, any help? camMode= sudo cat data.txt; echo "$camMode"; if [ "$camMode" == "True" ]; then echo Mode is true fi if [ "$camMode" == "False" ]; the...
asked by 27.12.2018 / 13:40
1
answer

break line in a txt in bash

I would like to print the processing of a route that is done by a CSV but when I read it I printed line by line in vertical, not horizontal, at this moment the script works correctly, it creates a text file and shows me the log of the records th...
asked by 26.12.2018 / 22:22
0
answers

Run subprocess.run on a terminal other than the one that executes the Python script

I'm writing a program in Python3 with a Tkinter GUI. I have included a terminal xterm in one of my frames: Frame2 = Frame(master) Frame2.place(x=self.anchoVentana,y=2*self.alto/3,width=self.ancho-self.anchoVentana,height=self.alto/4) w...
asked by 14.11.2018 / 11:35