command-line

Installer for a simple Mac OS command-line tool?

How can I build a novice-usable (clickable download) installer for a Mac OS X command-line tool, and where should the binary be installed so that a novice user with no knowledge of shell paths can just open the Terminal app and type "foo" to run the freshly installed foo tool? Can the installer also install documentation so that the use...

using sed to replace the contents of a file is not working in bash script

I have the following sed -e 's/<em\:update.*//g' install.rdf > install.rdf in a bash script, and it works on command line, but in the bash script install.rdf ends up a blank file. When I run sed -e 's/<em\:update.*//g' install.rdf > install.rdf command line, then 2 lines are stripped out of the file. Any idea why sed -e 's/<em\:update....

Batch (xcopy all files to folder) with loop

hello, can anyone help me with loop in batch for windows? i want make script that will allow me to do something like this: 1. copy all folders and files from Drive I: to X:\folder0001; 2. when done display: "Done"; (i ejected cd) 3. "enter" to next copy; 1. copy all folders and files from Drive I: to X:\folder0002; 2. when done display...

easiest way to pause a command-line python program?

Let's say I have a python program that is spitting out lines of text, such as: while 1: print "This is a line" What's the easiest way to allow one to press a key on the keyboard to pause the loop, then to resume if pressed again---but if nothing is pressed it should just continue on automatically? I'm hoping I don't have to go into...

Git: move existing repository from PC to server, clone from server

I have an existing Git repository on my local machine. I would like to move that repository to my web server, then git clone on my local machine to check out my repository from the server. I'm planning on then developing on my local machine and pushing updates back to the server. I can ssh from my local machine to the server, but not ...

How to get list of translatable messages

I know how to translate a natural language message into the user's language using gettext. But now I am wondering how to obtain a list of all translatable messages in a given domain. I have obtained a raw result with something like this: strings /usr/share/locale/${LANG:0:2}/LC_MESSAGES/$DOMAIN.mo but I am looking for a neater solu...

Specify Array from Command Line Argument

I realize that each argument passed from the command line is stored as a string in 'char *argv[]' I'd like to pass $ progname array[500] and pull the string from argv[1] subsequently specifying an array based on what I read in. Any ideas? ...

How to get list of ports which are in use at server from Delphi

I need to deal with the result of a command line like this: netstat -aon in Delphi, parse it and get to know all the ports already in use. Is there a library or component around that does that? ...

How to read command line inputs using a C program

Hi, How to read command line inputs using a C program. by command line inputs, I don't mean command line arguments!! example: * I have a text file 'inputfile.txt' with few lines of names. * Assume my program name is names.exe. * I have to run the program using windows command line using following command: c:>names.exe < inputfile...

How to grep download speed from wget output?

I need to download several files with wget and measure download speed. e.g. I download with wget -O /dev/null http://ftp.bit.nl/pub/OpenBSD/4.7/i386/floppy47.fs http://ftp.bit.nl/pub/OpenBSD/4.7/i386/floppyB47.fs and the output is --2010-10-11 18:56:00-- http://ftp.bit.nl/pub/OpenBSD/4.7/i386/floppy47.fs Resolving ftp.bit.nl... 213...

Bash, Serial I/O and Arduino

So, I'm in a bit over my head, and I feel like I'm very close to a solution but it's just not working quite yet. Here's my situation: I'm working with an Arduino MicroController, and I'm attempting to write two Bash scripts (right now running in MacOS 10.6) which will (a) print all serial data coming out of the Arduino unit to the stand...

Casting Command Line Arguments?

i have a command line executable program that accepts a configuration file as it's one argument for launch. the configuration file contains only 2 lines of code: #ConfigFile.cfg name=geoffrey city=montreal currently, the wrapper program that i'm building for this command line executable program writes the configuration file to disk a...

How do I change directory in command line with Clojure?

What I'm looking for is this kind of command line interaction at the Windows command line: C:\temp1>clj some_script.clj C:\temp2> Where some_script.clj contains something like: (cd "c:\\temp2") So the question is - how do I implement the function cd? Have experimented with clojure.java.shell, but it does not look like the lib I nee...

Git Windows Command Prompt gets stuck during Git commands with (END)

I've got Git for Windows setup (msysgit) and it was working fine for the last few days and today I've encountered an odd error. When issuing a Git command in the Windows Command Prompt or in the Git Bash that comes bundled with msysgit, I get a strange '(END)' line appear and then I cannot issue any other comamnds. At this point all...

How to read data from COM port using batch file?

Hello, Is there a DOS/ Batch command which can be used for reading from the COM port? I tried to look for that but didn't find solution... Thank you in advance. ...

Fortify command line usage

Has anyone used command line to run fortify? I tryin to incorporate fortify run in my CI build and I dont know how to do it. ...

Visual c# forms and command line interface

Hello, I'm trying to implement a command line interface inside of a windows form, I've looked into PDCurses but I'm not sure if thats where I want to be. Any one have any suggestions for this? ...

Java Runtime exec() behavior

I am attempting to programmatically generate javadocs via an instance of Runtime through the exec() method by passing in the commands necessary to generate javadocs. First of all I am unfamiliar with creating javadocs via the command line and second I am unfamiliar with the exec() method from Runtime. As a test I was able to execute exec...

Unix Script to Process multiple file names

I'm writing a script that will fold, sort and count text in a file. I need to design the program so that, if it is given multiple filenames on the command line, it processes each one separately, one after the other. I think I could write a loop but I don't know that much about those yet so if possible would like to try other options. Are...

How to run unit testing tests from command line?

I googled and found the below helpful references. Currently I want to run all from the command-line (for easy of execution & quickness) in cases: A specific test (ie. a test written by a method marked [TestMethod()]) All tests in a class All impacted tests of the current TFS pending change of mine. All tests All tests except the ones m...