command-line

How to escape parameter in windows command line?

I need to run the following command from the command line in Windows 7: SumatraPDF.exe -inverse-search "\"C:\Program Files\eclipse\inverse_search.bat\" \"%f\" %l" However I need to modify it a little, since my installation of Eclipse is located in here: C:\Program Files (x86)\Eclipse (C++) How do I escape this line correctly? Do I ne...

Which dll's are required to run osql.exe as a standalone?

According to the accepted answer to this question, the osql.exe utility can be run as a standalone program on a computer without SQLServer, simply by copying the binary file to the new computer. My question is, however, which other files need to be copied along with osql.exe for it to work? Thanks so much! ...

How can I embed a CR+LF in a command issued at the Windows command prompt?

How can I embed a CR + LF in a command I'm using at the Windows command prompt without actually issuing the command? Example: C:\Windows\system32>myprog -u user -p pass -text "Sincerely,\nRob" Is it up to myprog to do handle the line break? I figured there must be some way to represent a line break that the Windows command line would...

starting a windows executable via batch script, exe not in Program Files

This is probably batch scripting 101, but I can't find any clear explanation/documentation on why this is happening or if my workaround is actually the solution. So basically any terminology or links to good sources is really appreciated. So I have a program I want to execute via batch script (along with several other programs). It's th...

Unix alias command not working as expected

i have a command to kill some processes as below: kill -9 `psu|grep MF1pp|grep -v grep|awk '{print $2}'` the command works perfectly fine >psu|grep MF1pp|grep -v grep|awk '{print $2}' 29390 29026 $>kill -9 `psu|grep MF1pp|grep -v grep|awk '{print $2}'` $>psu|grep MF1pp|grep -v grep|awk '{print $2}' when i create an alias as below a...

Why do some cmd launched processes block/buffer output when the output is redirected?

Why do some processes started at the command line on my Windows machine block/buffer their entire output if it is redirected and others not? Example: tracert does not block/buffer output as it is written. If one executes: tracert ponyoverflow.com > output.txt ...the output.txt file grows over time. This is completely how I would ...

Calling php from php through exec() gives no result

I have a PHP script that creates other PHP files based on user input. Basically, there are files containing language specific constants (define) that can be translated by the user. In order to avoid runtime errors, I want to test newly written files for parse errors (due to "unusual" character sequences). I have read several posts here o...

linux batch rename directories and strip caracter # from name

Hello, i have a directory with a lot of subdirectories with a # infront of them: #adhasdk #ad18237 I want to rename them all and remove the # caracter I tried to do: rename -n `s/#//g` * but didn't seem to work. -bash: s/#//g: No such file or directory Any ideas on this. Thanks ...

Options for PHP CLI on windows

I'm working with the PHP CLI on windows at the moment to write some small desktop command-line apps. I wanted to know if and how it may be possible to: Clear the screen (cls would be the normal command but exec() won't work with it) Change the color, change the color of parts of the output (seen this in programs before) Make the comma...

How to empty ("truncate") a file on linux that already exists and is protected in someway?

I have a file called error.log on my server that I need to frequently truncate. I have rw permissions for the file. Opening the file in vi > deleting all content > saving works (obviously). But when I try the below cat /dev/null > error.log I get the message File already exists. Obviously there is some kind of configuration done o...

Windows command line search for exact extension with dir

When I do a search: dir /b /s *.txt I get all files/folders with the extension .txt But I also get them when they have an extension like .txtx But I don't search for .txt How can I search for the exact extension? ...

eclipse.ini variables

does eclipse.ini or eclipse command line does variable parsing? such as $PATH or ${java.home} ? ...

Run Iphone app in simulator from the terminal : how to set up iPhoneSim ?

Hi, I found this project which seems to make it possible to run an iPhone app from command line ! http://github.com/jhaynie/iphonesim Unfortunately there is almost no documentation and i'm stuck at building this project : I download all sources I run MakeFile and i get these errors : admin$ ./Makefile ./Makefile: line 4: -Werror:...

How to create mysql database from shell command?

I'm looking for something like createdb in psql or any other solution that would allow me to create databse with a help of a shell command. Any hints? ...

Batch command getting error

Hi Guys, I wrote a simple batch file which checks whether the c drive path exists then execute the exe in that path else try the d drive path and execute it. IF EXIST c:\program files\x goto a ELSE goto b :a cd c:\program files\x executable.exe c:\temp\col.zip :b cd d:\program files\x executable.exe c:\temp\col.zip Im getti...

Using Regex groups in bash

Greetings, I've got a directory with a list of pdfs in it: file1.pdf, file2.pdf, morestuff.pdf ... etc. I want to convert these pdfs to pngs, ie file1.png, file2.png, morestuff.png ... etc. The basic command is, convert from to, But I'm having trouble getting convert to rename to the same file name. The obvious 'I wish it work...

How do I compile a Java application that uses Apache Commons IO at the command line

Hi all, I made an application in NetBeans and I used the Apache Commons IO jar file. The application works fine in NetBeans, but I want to be able to compile it from the command line. The Apache Commons IO jar is with my *.java files but I get a commpiler error that says package org.apache.commons.io does not exist. ...

Windows Command Line

Does anyone know how to break out of a for loop when it's typed directly into the windows command-line? I know you can use gotos and labels to break out of it when it's in a batch file, but I can't find anything about breaking out of one on the command line. Here's a simple example: C:> for /l %i in (1,0,1) do @ping -n 1 google.com ||...

search text file using c# and display the line number and the complete line that contains the search keyword

I require help to search a text file (log file) using c# and display the line number and the complete line that contains the search keyword. ...

Running Eclipse's "HTML syntax validator (for php files)" on command line

I'm looking for a tool / script which validates the template files (php variables + html is mixed). I have tried 'tidy' but the results are not consistent as Eclipse and moreover Tidy doesn't handle such dynamic template files very well. So can anyone point me out in right direction? ...