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
Tag: linux
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…
Custom char device linux module under stock major (like “tty”)
I’m writing my first linux kernel module. It is a standard char device to communicate over a GPIO pin. It works like a charme. It is registered with its device name under /dev and in my own class name under /sys (it has some attributes available for configuration by the host application). My wish is to …
Can I be sure that a UDP recv executed immediately after a successfull call to recv with MSG_PEEK will not block?
Assume the following code (for the sake of simplicity I’ve omitted the necessary error handling here): In that case: Can I be sure that after the first call to recv the whole datagram is already received and therefore the second call to to recv will not block? Or can it happen that if IP splits the datagram, …