Questions tagged as 'unix'

4
answers

How to validate if a parameter is a whole number in UNIX?

I have to make a script that receives two parameters, of which the second must be a whole number. I have no idea how to validate that. if test $2 =~ "^[0-9]+$" then echo "\nNumero positivo entero" else echo "\nError: El numero $2 no es...
asked by 15.03.2016 / 02:20
1
answer

Ctrl-C on UNIX??

My question is this: Why in UNIX if I press Ctrl + C to finish the execution of a program, are there still times when I get the output of it? That is, I do not refer to situations in which the SIGINT interruption, caused by Ctrl + C, is handled...
asked by 21.01.2018 / 12:46
4
answers

Delete text after ==

A requirements file pip contains all the packages installed in Python, so that the file can be used elsewhere and rebuild the original programming environment. A requirements file looks like this: alabaster==0.7.9 arrow==0.8.0 awesome-slu...
asked by 10.03.2017 / 20:26
1
answer

Save date in unix format in Mysql

I need to store records with field in date and time in Unix format by default in a mysql table, is it possible to do that? Can you create a table with this field by default?     
asked by 01.09.2018 / 02:52
1
answer

problem when installing headers in kali linux

Hello, I was trying to install the headers in my kali linux to solve an error that I got in virtual box for this I do the following: $ dpkg -i linux-kbuild-4.6_4.6.4-1kali1_i386.deb $ dpkg -i linux-headers-4.6.0-kali1-common_4.6.4-1kali1_i386....
asked by 10.02.2017 / 13:35
1
answer

How to make a pipe in your own shell?

I'm creating a UNIX and there was a question: How to pipe in your own ? The command in String is a table respP This is an idea but I have not managed to apply it: if(tube==1){ //printf("\n\n\n"); // En el caso de un pipe, m...
asked by 08.01.2016 / 17:13
1
answer

Execute network service at startup on RHEL Server 7

I am working with the RHEL 7 server (MAIPO), but I have the problem that when restarting it, the network does not automatically raise and I have to press the button to start the network from the GUI. I understand that what happens is that the...
asked by 10.04.2018 / 23:02
2
answers

How does this Sed command work? [closed]

I wanted to know how this command works letter by letter, I do not understand it. find <directorio> -type d | sed -e 's;[^/]*/;|____;g;s;____|; |;g' The part of find <directorio> -type d I understand it well, which would...
asked by 06.09.2018 / 14:48
2
answers

Group results with current date

Example, I have a query mysql like this SELECT * FROM post WHERE fecha >= $time; where $time = current week I also have a array with the days, which are grouped $days = array('Lunes', 'Martes', 'Miercoles',...
asked by 26.06.2017 / 16:14
2
answers

Save all matches of a group in Regex

Consider the following group: ([0-9 ]+)+ I capture matches that contain numbers and spaces, in the following string for example: 123 , 2133132, 31331, 22222222, 23...... would capture "23", the last match, but what I want is to be abl...
asked by 27.05.2017 / 19:19