Questions tagged as 'unix'

6
answers

What does the symbol '~' mean in Bash?

What does this symbol mean ?: ~ I've seen it appear when you are going to install some components such as: php ~/composer.phar require cboden/ratchet or when I make a cd in the root: analistasistemas-VirtualBox / # cd analistas...
asked by 06.02.2018 / 17:09
1
answer

How can I select the lines between two patterns?

   Question and answer based on my own question and answer in How to select lines between two patterns? I have a file like the following and I would like to print the lines that appear between the patterns PAT1 and PAT2 . 1...
asked by 14.03.2017 / 16:16
0
answers

Redirect a port on Linux to different ports

I have the following: iptables -t nat -A PREROUTING -p tcp --dport 25565 -m statistic --mode nth --every 3 --packet 0 -j REDIRECT --to-port 25565 iptables -t nat -A PREROUTING -p tcp --dport 25565 -j REDIRECT --to-port 25564 With this,...
asked by 10.04.2018 / 15:42
2
answers

Replace literal in .html with Unix

I have a series of scripts declared in an html with the following format: xxx.jfhdskfjhdskjfhdskjfjioe3874.bundle.js. The part between the points is a dynamic hash, but it will always be an alphanumeric with the same positions. My problem is tha...
asked by 01.03.2018 / 11:12
1
answer

Doubt with fork system call ()

I have read about the operation of the call fork () and so far I have understood that it makes a copy of the process that is running and through a fork it is possible to know if we are in the process father or son as in the next example. N...
asked by 03.03.2018 / 17:55
2
answers

Problems executing mysql -u -p command

I have a problem and a few days ago I tried everything and I could not find the solution. On my server where my DB is hosted in MySQL when executing MySQL login mysql -u -p It shows me the following error mysql: [ERROR] unk...
asked by 12.01.2018 / 22:05
0
answers

Return of a UNIX program to a C program

Good evening, I am running a unix program from a C program, when the Unix program returns with an error, program C is not receiving the return value correctly. For example if the Unix program returns a 1 the program C is receiving a 256. Does an...
asked by 06.12.2017 / 01:45
3
answers

Program in C ++ or Java that works as a Unix command interpreter?

I wanted to know how to do, through object classes, a C ++ or Java program that is able to implement the following functions: string pwd() : returns the full path from the root in the same format as Unix. void ls() : shows b...
asked by 11.04.2016 / 20:14
1
answer

How to evaluate if the previous command has failed in csh?

I have a script that executes several commands. And there is one that I want to verify if it has failed and if so, show a message and finish. In bash I would use $? What do I have to use in csh?     
asked by 26.01.2017 / 09:13