I get the following error: I’m not sure what the process or port is and want to kill it so I can run my script again. How do I do that? Answer Example:
Tag: command-line
edit-and-execute-command bash with sublime text
In a bash terminal session, I notice that the edit-and-execute-command C-xC-e does not work with Sublime Text 3. I’ve set EDITOR=subl, but when I try to edit a command line from bash, sublime-text opens an empty window. Do I miss something ? Answer You should export the EDITOR as: as: To use Sublime Text as the editor for many commands
How to get a single output file with N lines from N multiline files?
I am looking for some effective way to concatenate multiple multiline files into one file – here is an example for three input files: 1.txt: 2.txt: 3.txt: output.txt: (Replacing each linebreak with single whitespace). Which way can you recommend? Answer Using BASH for loop: If you want to strip one ending space before each line break then use:
CHange php 5.4 to 5.5 on Hostgator
Currently on composer install I get the error need 5.5.9 but using 5.4 but on Hostgator cpanal it’s set as 5.5 On php -v I get On php –ini I get When going into /opt/ There is a php54, php55 and php56 How do I change my version to 5.5 I saw the following example on this link But when
CUPS printing remote(http://) files from command line
I am trying to create a custom script to control my CANON SELPHY PRINTER form the command-line. lp -d Canon_CP900 -o media=”CP_C_size” /Users/sangyookim/Desktop/selphy.jpg I have the tested the above code and it’s working perfectly as I intend it to. But I have stumbled upon a problem. When I replace the /Users/sangyookim/Desktop/selphy.jpg or filname to a web link such as the
How do I write this in a batch file
I am trying to convert a shell script into a batch file but I am stuck at this place. I am not quite sure how to convert this line into my batch file. I tried but I am not sure if I am right! Answer You can’t do command chaining like this in Batch. If I see that correctly, you
Can’t run PHP exec() on command line
Hoping someone can help me out here. Trying to run any command using exec() returns 126 and displays the same error message. I’ve narrowed it down to this pretty minimal test case. SELinux and PHP safe mode are not enabled permissions are fine on /, /bin/, and /bin/ls asterisk is a system user created with this command: adduser -d /var/lib/asterisk
Trying in PHP to mysqldump -v to popen and not getting output
I’m writing a wrapper for mysqldump and want to show the output nicely in a PHP CLI application. I’m attempting to run mysqldump -v using popen so that I can get the verbose output and display progress indicators to the user. However no output is returned (by default it gets logged to the screen via stdErr). I tried adding 2>&1
Function arguments in x86-64 asm
So I have to do this project for school that consists of reading a file in brainfuck and interpret it as assembly. The code works if I save the file path as a String inside the .data section, but what I want to have it so it gets the file path as an argument when starting the code in the
grep usage for date in a text file
I have some data in a text file like below: Now i want to fetch CPU Usage/Timestamp pair at a time like below: And, Memory Usage/Timestamp pair at a time like below: I tried grep -i “CPU Usage” testFile.txt | grep -i “Timestamp”, but it fetched the complete data irrespective of CPU Usage/Memery Usage. How can i do this so