Skip to content
Advertisement

Tag: shell

Linux shell change directory,file not found

I have written my convert.sh shell This is my working directory All executables and libraries are here, including tsmp. But when I run my script It seems that I do not understand alias. Following chepner’s comments,I have tried this But Why? Answer tsmp is not in your PATH environment variable, so you have to be explicit about where it is:

script to change format of text [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I want to change a text file that contains for example : a 1 b 2 a 3 b 4 to: a b 1 2

‘exec(): Unable to fork’ on Ubuntu 14.04.3 LTS

I’m running unittest scripts and for test case setup I need to run shell command from time to time. As a result shell command is run around 50 times during unittest execution. It works ok on CentOS release 6.6 (Final) server but doesn’t work on Ubuntu 14.04.3 LTS. The problem is that after around 20th time shell script execution I

Sort file based on information from different file

I have a file (f1) that contains two columns; f1 looks as follows: In a different file (f2), I specify how I would like individuals in f1 to be sorted based on their population; f2 looks as follows: I am looking for the following outcome: Could anyone please give me advice on how to achieve this outcome? Answer You can

Combining input and output shell IO redirection (in a nonstandard order)

What would this shell command do? And in general, how is this different from the other order of using < and >? When can it be used? I ask because I can only find examples of the other order (./myprog < myinputs.txt > myoutputs.txt which straightforwardly takes in the contents of myinputs.txt and writes the result of running ./myprog on

Programatically activate and deactivate network interfaces using nmcli

I wrote a script that deactivates all the interfaces available using nmcli commands such as: I would now like to reactivate these interfaces; there is no nmcli dev connect iface … command, and I’m stuck. In particular, my problem is to reactivate the Ethernet interface. Thanks in advance for your help! Answer Use this command: You can also use uuid

Combining two bash commands

If found this code which gives pi Ip address and this which sends 1.2.3.4 off to dweet.io stream How can I get the output from 1st to replace the 1.2.3.4 in second please? Answer Save the output of the first command in a variable: Btw, if your raspberrypi is running raspbian, then a much cleaner way to get the IP

Advertisement