I have a issue with the dd comand. I use it in a while like this: And it works like charm, the only problem is that once the file is read completely, it doesnt stop the while, it stays there stalled. How could I make the while to stop once the dd read all the file? BTW: Note my machine
Linux shell temporary DNS
In a linux shell script, I want to change the dns address temporarily. To do this, I can insert temprary dns address into resolv.conf right after the shell run and remove it before the script ends. That’s it. But the problem is, all every other scripts also hit the address while the script is running. T…
PHP exec command to write to server
So I have a bash script I want to run in php that has arguments but at the moment I cant even get PHP to write to the machine. As a basic test I tried the touch command to no success. I’m new to PHP so any help would be great. I don’t understand whats wrong here. I’ve tried: Answer
which is better? using cd and execute or using absolute path?
Suppose I would like to do some operation like touch/rmetc on a specific directory in shell script. Firstly, I can do cd to that directory and do it. Secondly, I can use absolute path to do that. My question is which one will be better in performance perspective? Which one is faster? Answer You can time it yo…
What is the advantage of using bash -c over using a here string [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
How to send SIGINT (Ctrl-C) to current remote process over SSH (without -t option)
I need to send a SIGINT to the remote process running in foreground in an SSH session. The SSH session is already established, so I cannot use option of starting it with (as described in How to send SIGINT to a remote process over SSH?) I know I could open a second ssh session and kill the process or close
external resolve dns linux bind9 [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
After securing my webserver (rpi) from foreign ssh logins, I found this perl script on my computer. Can someone tell me what it does? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 5 years ago. Improve this question There was an account named “user” that would be used fo…
How to check if process is running on Red Hat Linux?
I’ve been using a modified class I found to check if another instance of the same process is already running, the problem is that the method of checking for the process adds another instance of the same process. When my application starts, a new process ID is created and is visible with: With this I get…
Linux shell: my `expect` script doesn’t work as expected
I’ve got a simple script like below, read 2 numbers from command line and add them together: It runs, no problem. Then I wrote an expect script like below: Seems still it prompts to read from command line, after quite a long time, it ends. Where did I get wrong? Thanks. Answer You have to send the newli…