Let's say that I want to count the number of "o" characters in the text
oooasdfa
oasoasgo
My first thought was to do grep -c o, but this returns 2, because grep returns the number of matching lines, not the total number of matches. Is there a flag I can use with grep to change this? Or perhaps I should be using awk, or some other comm...
My team built a Java application using the Hadoop libraries to transform a bunch of input files into useful output.
Given the current load a single multicore server will do fine for the coming year or so. We do not (yet) have the need to go for a multiserver Hadoop cluster, yet we chose to start this project "being prepared".
When I run...
linux & unix shells can process subcommands like this.
$> command `subcommand`
does windows cmd shell similar feature?
...
hi! i have a proxy config file which has the following line:
Allow 212.21.3.44
i'd like to replace that ip address portion with my new ip address when it changes. it would probably be easier to just use the line number when searching for it - i don't think that config file will change at all other than that particular setting.
how c...
Hi, i am using c# language to build a console application. My target is i have to build a custom command like "do pfizer.text" and it'll create a file "phizer.text" on desktop.
I know i can do this with existing commands but i want to make my custom command ( "do" in this case).
Can anyone tell me how to do this ??? I will prefer c# la...
I have a file in my project directory that I want to run a script on:
myproject\file1
The script is in myproject\src\script.
When I go to run configurations -> arguments tab and put file1, I get an:
IOError: No such file or directory: 'file1'
What am I doing wrong?
...
I am working on a ZF application that needs to run a command line script and then parse the results into something meaningful and return to the user.
I know there are various PHP functions, like exec and system, but I was wondering if there is anything built into Zend Framework that does command line scripting easily.
Even if there isn...
I've spent a while on this but can't get this to work, I apologize as I asked a somewhat related question about this earlier but deleted it so I could do more research to narrow down the question, at this point I am stuck as I thought I had the solution with this but its not working as I expect.. I found a forum where someone asked a sim...
I some animations, they are like this:
/OP/
/OP/OP1/
/OP/OP1/OP1.rmvb
/OP/OP2/
/OP/OP2/OP2.rmvb
/OP/OP3/
/OP/OP3/OP3.rmvb
/OP/OP4/
/OP/OP4/OP4.rmvb
...and more
I want to make it like
/OP/
/OP/OP1.rmvb
/OP/OP2.rmvb
/OP/OP3.rmvb
/OP/OP4.rmvb
I tried
move \OP\*\*.rmvb \OP
It gave me error says
...
Similar to this question:
http://stackoverflow.com/questions/911426/get-all-files-from-vss-for-a-given-date
I am trying to write a script that get a VSS project tree for a specified label. I have this:
:: Path to the SS.exe command
set ss="C:\Program Files\Microsoft Visual SourceSafe\ss"
:: Path to the srcsafe.ini file for the reposi...
Instead of going to Extension Builder > Build Package…, I'd like to built a .safariextz package from the MyExtension.safariextension folder.
I know I can unpack an extension with xar -xf. I suspect the way back involves packing it with xar, but then I'll need to do the code signing thing, which may or may not involve codesign(1).
...
I have a jpeg image of 400x400 px that i want to paste into a 960x640 image.
Is there a command line image processor that I can use on OSX?
Thanks!
...
I have a program that accepts a Cmd command as a command argument.
Basically you call it this way: C:\MyProgram.exe del C:\test.txt
The above command works fine. However when I try to do an xcopy command it fails:
C:\MyProgram.exe xcopy C:\test.txt C:\Temp\Test2.txt
The code of the program:
class Program
{
static void Main(str...
I tried the following in cl:
javac Main.java
The shell gives an error that "javac" is not a recognized command. I know for a fact I have the Java Platform installed. What could be wrong?
(I use "cd" to set the directory first)
...
How do you tell if a computer's monitor(s) are turned on/off from the command line in Linux? I've traditionally thought of monitors as output-only devices, but I've noticed the Gnome Monitor Preferences dialog has a "detect monitor" function. Can this be generalized to determine if a monitor is physically turned off?
...
I'm trying to make a .NET wrapper for an REPL (specifically Scheme, but I haven't got to where it matters). I looked for some sort of expect-style library, but I couldn't find one, so I've been using a System.Diagnostics.Process. I don't think I'm succeeding at reading and writing correctly.
Here's my code; it's in IronPython, but I h...
I started using Haml/Sass thru Rubygems recently, and I'm really liking it (although that doesn't have much to do with my question)...
I would like to create a simple script I can throw in the root directory of each of my projects that will launch terminal, cd to my CSS folder, and run sass. so essentially a script that:
cd ~/path_to_h...
I would like to call the Java class file from compiling the following code:
import java.io.*;
public class hex_to_dec {
private BufferedReader bufferedReader;
private BufferedWriter bufferedWriter;
public hex_to_dec (String stringPath, String stringPath_dec)
{
try
{
bufferedReader = new Buf...
i have created a win32 window it work fine but im tryin to get command argument using lpcmdline. it works fine but when i try to compare it to string it to does work here is the comparing code
TCHAR checking[]=_T("hello");
if(args==checking) // args equals lpcmdline like this LPTSTR args=lpcmdline
{
TCHAR greeting[]=_T("heys");
}
e...
I would like to create an environment variable to hold a filename something like:
PREFIX-2010-AUG-09.zip
I can get close if I use something like this:
SET filename=PREFIX-%date:~-4,4%-%date:~-7,2%-%date:~0,2%.zip
Result:
PREFIX-2010-08-09.zip
but in this case, I get the month as two digits (08).
Is there any easy trick in Windo...