command-line

supplying inputs to stdin programatically line by line ?

I have a test program which prompts for input from user(stdin), and depending on inputs, it asks for other inputs, which also need to be entered. is there a way I can have a script do all this work ? ...

Periodically shut down a program

I want to kill an executable of a game named KnightOnline and deny user to run it. I'm using: Process.Start("taskkill.exe", "/f /im kol.exe"); but it's showing a command window. How can I hide the command window, or is there another professional but infamous method to deny an unwanted program? EDIT: I edited hosts and blocked login p...

Is there a way to make a HTML link that would run a program from local computer?

For debugging purposes it'd be nice if I could make my error page display clickable file names in exception stack traces that would open them up in my favorite editor. However this would require me to execute a full command line - a simple link to a file will not do. Can this be done? The solution can be IE-only and it can use techniqu...

Using lsof to get a list of file names

EDIT 1 I'm having problems using the arguments given. Maybe it is the way I'm passing my arguments through NSTask? Any suggestions as to how I can do this? NSTask *file_Task = [NSTask new]; [file_Task setLaunchPath:@"/usr/sbin/lsof"]; [file_Task setArguments:[NSArray arrayWithObjects:@"+p", the_Pid, nil]]; Good Afternoon Fellow Cod...

Sorting words in lines in a file and output sorted lines again

I want to sort the words on lines in a file line by line and I want the ouptut to be lines with the words sorted alphabetically. for example: queue list word letter gum another line of example words ... I want the output to be: gum letter list queue word another example line of words ... I can't seem to get it to wo...

Command Line Arguments in Imported Python Modules

This is more a question of coding style, but I have a script that processes a particular file (or set of files). It would be nice to allow the user to provide those files as command-line arguments. Of course, it's possible that the user forgets to provide these or the filenames are invalid, so I have to introduce a try/except here. Prob...

View line-endings in a text file

I'm trying to use something in bash to show me the line endings in a file printed rather than interrupted. The file is a dump from SSIS/SQL Server being read in by a Linux machine for processing. Is there any switches within vi, less, more, etc? In addition to seeing the line-endings, I need to know what type of line end it is (CRLF or...

CLI pdf viewer for linux

Hey, for quite a while now, I am looking for a pdf viewer for the command line. As I like to work without X on Linux, and often work on a remote machine, I would like to have a tool to read pdfs. There are quite a lot of really good graphical programs (evince, okular, acroread, ...) to do the job, so I figured there should be at least o...

How to make GPG keys accessible for PHP shell_exec

I am working on a script that needs to run a perl script via command line (using shell_exec()). To set up the script I needed to generate a GPG key on my end, and import their public key into my GPG keyring. The perl script works fine when I run it as the ROOT user, but when running through PHP it throws this error message: "An error o...

How to set command line enviroment variable in PHP shell_exec

The script I am trying to run via shell_exec in PHP requires an environmental variable to be set, which afaik is done via: export VARIABLE=value However, to run the script I am forced to do: <?PHP $sOutput = shell_exec("export VARIABLE=value && my_command_goeth_hereth"); It seams kinda pointless to have to export the variable every...

How do I diassemble a an object program made on C?

How do I diassemble a an object program made on C(linux)? Can anyone please help me with the command line. ...

Delphi command-line compiler

Hi everyone I have a project with a few apps with a couple of {$DEF aaaaa} and then I use Inno setup to do a installer. To streamline the process it would be great to create a batch file to do the whole thing from A to Z. Hence the need to use the line compiler I never did that in 10+ years of delphi. Given that the help is... well we ...

how to allow a process created by another process, use a part of memory of the creator process ?

I got two console processes that second one is created by first one using the API below: BOOL WINAPI CreateProcess( __in_opt LPCTSTR lpApplicationName, __inout_opt LPTSTR lpCommandLine, __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in BOOL bInherit...

Command line Disconnect from VSS

We are moving from VSS 6.0 to SVN and I am trying to automate some tasks to make my life easier. Is there a way that I can disconnect a solution (containing an SSIS Project, SSAS project) or a SSIS project from Visual Sourcesafe from the Command-Line? ...

Creating symlinks in Windows for Hudson build

I have a job in Hudson that builds on a Windows XP slave. I know that symlinks are not possible (directly) in Windows XP, and so I am trying to use junctions instead. I wrote a batch script: @echo off if "%1" == "" goto ERROR1 if "%2" == "" goto ERROR2 goto create :create echo Creating junction for %1 at %2 if exist %2 junction -q -d %...

XML pretty-printer with fixed line-width output

I need a command-line XML pretty-printer tool that will not overflow given output line width. All tools I've tried (xmlstarlet, xmllint, xmlindent) overflow line width when printing tags with many attributes. I'll settle if each attribute will be printed at a separate line (while keeping indentation of course). Tool must be free, runna...

Downloading a full remote directory via FTP from the command line

Hey guys, I'm looking to put together a simple scriptable backup utility to grab all the files on a remote ftp server and drop them in a backup directory on my machine. I already tried the built-in Windows "ftp" command and Filezilla's limited command line options, but neither seems to be able to grab the whole document tree in one go. ...

Possible to call executable Thor-powered script without calling thor?

I have a thor-based Ruby script, but I want to deploy it as a gem in people's bin directories that people can hit without having to do thor mytool. So instead they'd just use mytool Is this possible? I know it's possible with vanilla optparse but I'd rather use Thor if possible. Update: This is the code I'm using based on the example...

How to export all installed versions of Java to a text file under Windows XP

I'm looking to write a batch file I can deploy to 20-30 users that will export all of the enabled versions of Java out to a text file, which I can then pick up, and add to a troubleshooting effort we're working on. I know that java -version will show the current version, but we're in an environment where we have multiple applications th...

Run garbage collector from command line?

Is it possible to run .NET garbage collector from command line, e.g. without writing code? ...