command-line

Is there a way to find a specific file and then change into the directory containing it in one go?

I'm looking for a way to find what I know will be a unique file, and then change into the directory containing that file. Something along the lines of: find . -name 'Subscription.java' | xargs cd Or: find . -name 'Subscription.java' -exec cd {} \; I know this won't work because it's both trying to cd supplying the entire absolute path, w...

How to attach a SQL Server database from the command line

Is it possible to enter a command line command (like in a batch file) to attach a detached database to SQL Server, in stead of opening the management studio and doing it in there? ...

I am trying to use gnu screen on mac

I have ~/.bash_profile which I would like to be invoked every single time a new GNU screen is created so that all my aliases work in GNU screen as they work in terminal. At this time this is what my ~/.screenrc looks like. hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C...

How do I use VS2010 One-Click Publish (MsDeploy) to deploy remotely from the command line?

On the remote web server I have installed the remote service http://x.x.x.x/MsDeployAgentService. If I use the Web Application Project's Publish command in VS2010 I can successfully publish to this remote web server and update a specific IIS website. What I want to do now is execute this capability from the command line. I am guessing...

Can't add classpath through command line

I want to add the classpath through a command line call. The call looks like this: java -cp ..\conf -jar ..\lib\zpv-ekvkumsetzer-0.0.1-SNAPSHOT.jar In the conf directory is an XML file that defines the application context and the log4j.properties file. But when I run this command, Java obviously can't find those two files, although I'...

MySQL command line issue - ambiguous option --s

Hi I'm getting the error below everytime I run a mysql or mysqladmin command - even mysql --help!! ambiguous option '--s' (set-variable, shutdown_timeout) (The daemon is fine) Any ideas? Thanks Daniel ...

searching multiple strings in a single file

I want to find the lines in which atleast one of the strings among string1 and string2 are present in the file. grep 'string1' 'string2' file;-this is an error even though!! how could i do the above on unix command line? ...

PHP system() help

Hello, I have this shell script #!/bin/sh ############################################################# # Example startup script for the SecureTrading Xpay4 client # # Install Xpay4 into /usr/local/xpay4 # # To run this script automatically at startup, place the # # following line at the end of the bootup...

How can I use Perl to get a SHA1 hash of a file from the Windows command line?

I have a file called secure.txt in c:\temp. I want to run a Perl command from the command line to print the SHA1 hash of secure.txt. I'm using ActivePerl 5.8.2. I have not used Perl before, but it's the most convenient option available right now. ...

Linux: cat matching files in date order?

I have a few files in a directory with names similar to _system1.log _system2.log _system3.log other.log but they are not created in that order. Is there a simple, non-hardcoded, way to cat the files starting with the underscore in date order? ...

How to run a custom action after install which can run in quiet or a UI after Install (WIX)

Hi, I basically want to able to run an command line tool that already exists on the desired machine against the directory the files were run to. I.e The Installer does the following: Specify a location for the files to go into (INSTALLOCATION variable) Then after copying has finished run a tool which will zip the files and attach them...

Python print statement prints nothing with a carriage return

I'm trying to write a simple tool that reads files from disc, does some image processing, and returns the result of the algorithm. Since the program can sometimes take awhile, I like to have a progress bar so I know where it is in the program. And since I don't like to clutter up my command line and I'm on a Unix platform, I wanted to us...

How can I convert Perl one-liners into complete scripts?

I find a lot of Perl one-liners online. Sometimes I want to convert these one-liners into a script, because otherwise I'll forget the syntax of the one-liner. For example, I'm using the following command (from nagios.com): tail -f /var/log/nagios/nagios.log | perl -pe 's/(\d+)/localtime($1)/e' I'd to replace it with something like th...

How to prevent GUI (VB6) program from returning control when run from a command line?

There is a VB6 application. It can be run with command line parameters to create some report in a text file. The problem is that when started from a batch file, application returns control immediately, so the following commands start executing. I need these following commands to wait until the VB6 app finishes its work. How to achieve ...

Is there any good guide for using the Cassandra Command line Interface?

I wanted to try out Cassandra, and thought the easiest way to get up and running would be via the command line. I was wondering if there is a good guide to using the cli tool that is shipped with Cassandra. I am primarily looking for options to create column families, super columns, insert sample data and query them. The documentation on...

Is there an equivalent of Mac OS X "open" command that can be called from C++/Objective-C code?

On Mac OS X there is a very useful "open" command which launches an application suitable for opened file type. Is there some C++/Objective-C function on Mac which does the same? Note: I know I could launch an "open" process. I'm just not sure if it's the best option. ...

Package SWF into an EXE or APP

I am trying to adjust my Flash development workflow so that I am using Flash Builder for all of my coding and multiple FLA files for the user interfaces. I will be creating an ActionScript project in Flash Builder and then having each FLA export a SWC into a resources folder. It is important that I retain the ability to export PC and Ma...

Controlling Gnome Volume using DBus

I'm pretty new to the whole DBus stuff so excuse me if this is trivial, but I was wondering whether, using DBus, it is possible to set the audio volume from the command line. ...

How to extract block of XML from a log file on Linux

I have a log file that looks like the following: 2010-05-12 12:23:45 Some sort of log entry 2010-05-12 01:45:12 Request XML: <RootTag> <Element>Value</Element> <Element>Another Value</Element> </RootTag> 2010-05-12 01:45:32 Response XML: <ResponseRoot> <Element>Value</Element> </ResponseRoot> 2010-05-12 01:45:49 Another log entry What...

C++ Beginner - Best way to read 3 consecutive values from the command line?

Hello everyone, I am writing a text-based Scrabble implementation for a college project. The specification states that the user's position input must be read from single line, like this: Coordinates of the word's first letter and orientation (<A – P> <1 – 15> <H ou V>): G 5 H G 5 H is the user's input for that particular example. T...