Questions tagged as 'shell'

2
answers

How to execute create mysql database using shell script if base name has "-"

On the server there are some databases named modelo-submodelo (this is the name of the database, created with "-" same). When I execute a command like: mysqldump -h"$DBHOST" -u"$DBUSER" -p"$DBPASS" modelo-submodelo --compress=TRUE &g...
asked by 29.03.2017 / 15:30
1
answer

Wrong ping response

Considering that ${parameters} is an array that can contain valid IP addresses or not, I wrote the following code: for ((i=0; i<$#; i++)); do eval "arg=\${$i}" ping ${parameters[i]} -c1 -q &>/dev/null...
asked by 19.09.2016 / 05:19
2
answers

How to print global IPv6 using grep and awk?

There are already a few days that I am searching the Internet for such a response but I have not gotten any so far. I'm trying to figure out ifconfig's Global IPv6 to be used on MOTD on Ubuntu. With IPv4 it was quite easy to do this with this...
asked by 16.02.2017 / 15:34
2
answers

Error in using aliases and read in ShellScript

I'm trying to create a command in the .bashrc of ubuntu, however I'm having a problem, I'm trying to create a folder with the variable entered at the time of calling the alias, but this is giving an error. When I open the terminal it already ask...
asked by 20.02.2016 / 17:14
1
answer

Delete in the table via Shell Script

I'm trying to do a delete of all rows from a table via Shell Script. The database is oracle. The bank for some reason does not let me do truncate and the delete simply does not delete, without presenting any error. I do not really know why, when...
asked by 24.05.2014 / 00:29
2
answers

Shell_Exec (): How to keep process active when restarting apache?

The processes run by php's shell_exec () end up restarting apache. Is it possible to keep processes running uninterrupted when restarting apache? Below the code I'm using: $Command = "ksh -c '( trap \"\" 1 2 3 4 15; "; $Command .= "./sc_se...
asked by 31.08.2014 / 19:25
1
answer

Framework (Java) for Opening Remote Sessions for Execution of Commands on Unix-based Server

I needed a framework to be able to open remote sessions on (Unix-based) servers and execute commands remotely (if possible as% with% same). Does anyone know of any and mature that can serve this purpose? Main purpose: What happ...
asked by 07.10.2014 / 17:16
1
answer

Create an environment variable for users without access to bash (/ sbin / nologin)?

I'm trying to create an environment variable that will be accessed by a php script by the user running httpd (user: apache). It is defined as /sbin/nologin and therefore does not access .profile , profile , .bashrc , etc...
asked by 12.11.2017 / 17:30
1
answer

execute shell file in ubuntu by crontab

I'm trying to do a task schedule in linux to run a sh file, however, it does not run by crontab , but it does when done in the hand. I did a scheduling test to create a text file, it works, but to run sh does not. Here...
asked by 08.06.2017 / 13:01
2
answers

How to delete the first line of a megapesado SQL file?

I have a "mega-heavy" SQL file that does not open either in sublime, in notepad or in gedit. I just need to delete the first line Use nome_database; to be able to import through the workbench or mysql command line in the terminal: mys...
asked by 18.04.2016 / 19:41