Questions tagged as 'shell-script'

2
answers

How to send commands to the ruby interpreter from a Shell Script?

This is more out of curiosity ... I've seen some examples of what I want to do, but in Perl. I tried to find a way to do the same in ruby, but to no avail. I want a function to generate an MD5 hash from a word passed as an argument. The inten...
asked by 04.07.2016 / 04:03
2
answers

Shell / Bash - Script continues before finishing the line that is running

I have a shell / bash script that works perfectly for making backups, the problem is that I have large files that are giving problems in running the script. The script has to compress the file in tar.gz format and it does this, but when i...
asked by 09.08.2016 / 20:03
2
answers

How to send the result of an email query SHELL SCRIPT

I have the following query: #!/bin/bash db="bats"; table="promotion"; dbHost="192.168.0.246"; dbUser="root"; dbPass="root"; result='mysql -h $dbHost --user=$dbUser --password=$dbPass --skip-column-names -e "SELECT name FROM $db.$table WHERE...
asked by 11.05.2016 / 23:53
1
answer

How to declare a variable in .BAT ("shell")? [closed]

I'm starting to mess with .BAT file, and created a command line. Example: ping <nome do computador> Below it would show me if it is online, it would look like this: ping computador_1 ButIwantedtoputthenameofthePCorIPintoavariabl...
asked by 25.10.2018 / 14:21
1
answer

How to pass vector as argument in shell script?

I would like to pass a JSON-style vector as an argument to a script. Example: #!/bin/bash vetor[]=$1 echo ${vetor[*]} i=0 for nomes in ${vetor[*]} do i=$(($i+1)) echo "Nome $i é $nomes"...
asked by 04.09.2018 / 16:48
1
answer

Problem executing a shell script using Zenity. Message: Gtk-Message: GtkDialog mapped without a parent transient. This is discouraged

When I run script.sh via linux shell, this message appears: Gtk-Message: GtkDialog mapped without a parent transient. This is discouraged. How do I resolve this? #!/bin/bash get_url () { url=$(zenity --entry --title="Youtube" --text="...
asked by 30.07.2018 / 02:04
1
answer

How to pass variable to PHP file in Shell Script

How can I do to pass a variable to a php file in a shell script, I'm trying to do that below, without success. php -f complete.php?login=$1     
asked by 20.08.2018 / 00:20
2
answers

Append .html extension to the end of all links in multiple files (with Shell Script)

Hello. I have a lot of HTML files that have links in the following format: http://localhost:8080/tag:alguma_coisa and I need to add the .html extension to these links so they look like this: http://localhost:8080/tag:alguma_c...
asked by 13.05.2018 / 19:10
1
answer

Write output from bash linux, in a file

I need to do some testing on the linux command line, but doing all the testing is very time-consuming, can anyone help me, if I can, write code in shell script to run all tests, and write output from bash in a txt file?     
asked by 27.10.2017 / 18:08
2
answers

Check empty directories and catch command output

I have a folder called work and inside it I have 2 folders: p1 and p2 . How can I tell if the p1 and p2 folders are empty? I have the following command find . -type f -printf "%T@ %p\n" | sort -nr | cut -d\...
asked by 24.11.2017 / 17:29