The exercise consists of evaluating the files contained in a directory, depending on whether they are:
Directories
Executable
Device
Regular files
My moment code is this:
# Clasificamos el contenido del directorio
# Contad...
The command
tar -cvfz archivo.tar.gz fichero1 fichero2 fichero3
It returns the following error:
tar: archivo.tar.gz: No se puede stat: No existe el fichero o el directorio
tar: Exiting with failure status due to previous errors
I do no...
I have a simple script in bash :
#!/bin/bash
echo "Hello world"
And he executed it on my console with a simple:
user@host: $ sh script.sh
Hello World
That said, I would like to execute the above ( sh script.sh ) by means o...
I'm trying to make a script that checks the date of the files of different directories and if they are older than 7 days since the last update send me an email.
To begin with, I would like to know how I can extract the date from the files. I...
I'm working on a script that gets information from a log called ip.txt and contains the following:
192.168.7.x OK
192.168.9.x OK
192.168.5.x OK
Looking for help, I managed to make it print a status depending on the file if all the IPs have...
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...
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\+'
I am writing a Script in which one of the functions is to search in a text file DNI or Name that the user is asked for and when he finds them he will print the whole lines.
The file has the format "DNI | Name"
2:Pepe
21:Julio
1:Marta...
I am trying to write the result of a command in a text file but I can not write anything.
This is my code
f directorio2 == nil
directorio2 = 'pwd'
directorio2 = directorio2.to_s
end
puts "#{directorio2}"
system "diff -rs #{directorio1...