Questions tagged as 'shell'

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

Doubt about shell script

I'm studying linux, and it's my first contact with the shell script, the documentation I wanted to do is: #!/bin/bash if [ uname - m = "x86_64" ]; then echo "sua versão é de 64bits" else echo "sua versão é de 32bits" fi I tried to use...
asked by 01.09.2018 / 21:52
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 check if a connection is "sleeping" in php?

I have the following script: $fp = @fsockopen($IPAddress, $newport, $errno, $errstr, (float) 0.5); if ($fp) { echo("Conectado\n"); } else { echo("Desconectado\n"); } This script checks if a particular port is open, works fine. I...
asked by 06.09.2018 / 20:04
1
answer

Shell command

I need to copy the last file created in a directory to another via ssh . I am using the following command: ssh -oStrictHostKeyChecking=no user@IP "cd /home/user/backup_database/hour/; cp "'ls -1trap | grep -v '/$' | tail -n 1'" ~/"...
asked by 19.01.2018 / 15:14
1
answer

How to interact with PHP with the Dialog interface of Shell Linux?

How to interact with php7-cli with the Dialog interface of Shell Linux, displaying values of variables on the screen?     
asked by 14.01.2018 / 17:02
1
answer

Bash program does not display data output

Good afternoon, I'm programming in C and it's the first time I'm programming in Bash (shell-script). I did some bash functions, learned to call and created an interactive menu with the user, my program does "basically" reading a wordlist a...
asked by 26.12.2016 / 17:08
1
answer

In bash, what is the difference between a null string and an empty string?

I would like to know if there is a difference in how bash represents variables with null values var= and with empty strings var="" What precautions should I take when handling variables like these?     
asked by 24.12.2016 / 20:33
1
answer

Root permission to change date and time [closed]

I would like to know how I can get my script to change system date and time without asking to enter the root password?     
asked by 22.11.2016 / 23:32
2
answers

PHP running PYTHON

I'm trying to run a python script through php, but it does not run python. I used the code to test: $cmdResult = shell_exec("ls & /usr/local/bin/python2.7 --version & echo done"); Returned: done LICENSE example.py When I typ...
asked by 25.07.2016 / 21:39