Questions tagged as 'shell'

1
answer

how can I capture in an array the text of a line from a txt file? in the shell

I want to capture the text of each line of a text file example text Finally, I indicate that if we invoke the command without counting options (count lines, words, etc), the command will directly return four columns: the count of words, lines...
asked by 02.08.2018 / 21:20
1
answer

save in variable values of grabc

How can I save the RGB values of grabc in variables? grabc -rgb or this other code: xwd -root -silent | convert xwd:- -depth 8 -crop "1x1+$X+$Y" txt:- | grep -om1 '#\w\+'     
asked by 24.07.2018 / 05:27
2
answers

I have problems with pip on mac osx

I am trying to install a library for python 2.7 in mac osx with pip in the following way: python -m pip install pyttsx and the shell returned: /usr/bin/python: No module named pip Then I tried to prove that if it existed with pyt...
asked by 08.05.2018 / 05:27
1
answer

Command logs executed via terminal

There is a file .log where you can see the commands applied via terminal in Linux , I usually apply the command history to verify previously executed commands, but this time they deleted the history and I have no trace of whi...
asked by 16.10.2017 / 21:26
1
answer

Problem running a shell in php

I want to run a shell file from php using this command: system('./12.sh'); And the content of that shell file is as follows: #!/bin/bash source ~/.virtualenvs/cv/bin/activate python /home/raul-pc/Documentos/codigo/rec_face.py When...
asked by 04.05.2017 / 22:00
1
answer

Enter text in a file in a certain column Shell script

I have to modify column 5 of a separate text file with : (colon). For the text that the user enters, I already cut column 5 with cut -f5 -d: , but I do not know how to enter the text in that empty space that remains. The text tha...
asked by 03.11.2016 / 20:20
1
answer

Shell Script create script alert file creation

I'm trying to create a script, that I detect the creation of directories / files / subdirectories, and that after that, I execute another statement / command Example: Launch a script, and if in / test / detect that it has been created, create...
asked by 02.03.2018 / 16:57
0
answers

MySQL query from script [closed]

I have a computer connected by SSH to another computer from which I want to run a bash script to query an external host in MySQL. I connect without problems from the command line as follows: mysql -h HOST -u USER -pPASS Once connected, I...
asked by 14.08.2017 / 12:28
3
answers

shell to concatenate files

Good day, I need to implement a shell which is able to concatenate several .txt files in a single file as if it were a unique script in this file. In addition, you must identify when a new txt is added and be able to concatenate it in the same f...
asked by 12.11.2018 / 23:30
2
answers

Error: Too many arguments

I need to compare all the words that I pass as arguments between them, and say if they are the same or not: #!/bin/bash #Ejercicio_4 if [ $# -ne 6 ] then echo Número de argumentos incorrecto else if [ $1 == $2 == $3 == $4 =...
asked by 29.12.2018 / 02:23