command-line

Is learning ed worth it to boost my speed in VIM?

I've learned the basic/intermediate levels of VIM (it's too vast to list). I often find that I slip back to my old ways and start using the mouse, holding down keys to get somewhere, and doing other stupid things that could be sped up. Would it be worth spending time to learn ed to break the habits learned from years in a point and cli...

Convert URLs into HTML links using sed?

I'm wondering if it's possible (recommended might be the better word) to use sed to convert URLs into HTML hyperlinks in a document. Therefore, it would look for things like: http://something.com And replace them with <a href="http://something.com"&gt;http://something.com&lt;/a&gt; Any thoughts? Could the same also be done for emai...

grep for value of keyvaue pair and format

When I do the following ps -aef|grep "asdf" I get a list of processes that are running. Each one of my process has the following text in the output: -ProcessName=XXXX I'd like to be able to format the out put so all I get is: The following processes are running: Process A Process B etc.. ...

Commit all folders and files in a directory using commandline

Hello everybody We are having trouble with having a generalized approach to committing with a batch file using commandline svn. We've got a backupscript that created a new folder with the current date containing the database dumps of our database. (Yes, we version control our database). Now how can I use the svn commit command to incl...

How to browse each version of each element archived?

I am looking for a command line either for an algorithm (script) which allows to browse all the versions of each of the elements archived in a VOB UCM or Base Clearcase. The command find allows to browse each of the elements accessible from an existing view. But It does not thus allow to browse elements uncatalogued. It is more complic...

Learning resources for Linux filesystem, command line, and structure

Can anyone suggest some good materials for learning more about the Linux filesystem and command line? I have found myself frequently confused as to what programs go where on the Linux filesystem. I would like to learn how the various directories (var, etc, usr ...) are used and how to use the commandline more effectively. I come from th...

need help in writing ant target

I am new to writing ant targets. I've to pass 3 arguments from the command line to java program. All these can be optional and can have spaces. How can i do that using ant target. I tried using but if it delimits the arguments by space. So, if my first argument has space then it takes the word after space as second argument. I also t...

The value returned from a function in a windows batch script is ignored in a FOR loop

Hi, I need a script that inserts a number at some point into a file path, like this: from C:\WINDOWS\system32\ansi.sys to C:\WINDOWS\system32\5.ansi.sys I made a function using a label and it seems to work fine, until I invoke it from within a FOR loop. This is the code I wrote: @ECHO OFF SET PATHTOPROCESS="C:\WINDOWS\system32\ansi...

How to access a command line application's bundle in C

Hi, I am on a Mac, programming with Xcode. I have a command line application that will read/write to files in it's bundle and I was wondering how to access these files. Thanks, Mr. Man EDIT: Would it work better if I just made a folder in the user's library folder? ...

While decrypting the web.config get an error

Hi Guys, I am just trying to test this. And here is my command line: aspnet_regiis.exe -pdf "connectionStrings" c:\web.config And this is the error I got. Error – "The configuration for physical path ‘C:\Web.Config’ cannot be opened. And the permissions of that file is not read only. Can anyone please suggest. ...

a command line or a script who is able to display each version of each element archived in a vob since the beginning?

Hello, For example, I am in a vob called: avob I add to source control a folder: avob/afolder I add to source control two files afile1 and afile2 avob/afolder/afile1 avob/afolder/afile2 I uncatalogued the file afile2 I add to source control afile3 avob/afolder/afile3 I would like (a command line or a script who is able to) display eac...

dos batch iterate through a delimited string

I have a delimited list of IPs I'd like to process individually. The list length is unknown ahead of time. How do I split and process each item in the list? @echo off set servers=127.0.0.1,192.168.0.1,10.100.0.1 FOR /f "tokens=* delims=," %%a IN ("%servers%") DO call :sub %%a :sub echo In subroutine echo %1 exit /b Outputs...

Java's Scanner class: using left- and right buttons with Bash

I'm not too familiar with Linux/Bash, so I can't really find the right terms to search for. Take the snippet: public class Main { public static void main(String[] args) { java.util.Scanner keyboard = new java.util.Scanner(System.in); while(true) { System.out.print("$ "); String in = keyboard....

Appending rather than overwriting files when moving

I have the following directory structure: +-archive +-a +-data.txt +-b +-data.txt +-incoming +-a +-data.txt +-c +-data.txt How do I do the equivalent of mv incoming/* archive/ but have the contents of the files in incoming appended to those in archive rather than overwrite them? ...

Running DOS command through C# just opens blank cmd window

I was trying to execute a command through C#, but when I run the following code, a blank cmd window just opens up. The code: string command = string.Format(@"adb install C:\Users\Mohit\Programming\Android_Workspace\{0}\bin\{0}.apk", appName); ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe"); cmdsi.Arguments = command; Process cm...

Unix [Homework]: Get a list of /home/user/ directories in /etc/passwd

I'm very new to Unix, and currently taking a class learning the basics of the system and its commands. I'm looking for a single command line to list off all of the user home directories in alphabetical order from the /etc/passwd directory. This applies only to the home directories, and not the contents within them. There should be no d...

Why am I getting a TypeLoadException when defining a custom profile?

I'm writing a .NET command-line application that will migrate users from an existing database into aspnetdb. To simplify the user-specific settings, I'm using the profile class that Joel Spolsky wrote about here. It works great in the ASP.NET MVC website, but for some reason it's throwing a TypeLoadException when being used from this n...

Why I cannot get the output of ftp.exe by code?

I execute the ftp.exe cmd through a C# System.Diagnostics.Process type. And I use the following code to get the "ftp.exe" output after I programmatically enter a "help" command. But I can only get the first line of the result. And I never get to the "end" output part. The whole program seems blocked. Process p = new Process(); p...

how to find the percentage of free space for mapped drives ?

Is it possible to programatically find the free space available in mapped drives? How to find the percentage of free space in your drive using ms-dos. It may be easy to find the free space for a drive in ur hard disc but i need to find the free-space of mapped drives. I have mapped some file servers in my systems. It is possible to ...

When appending to a file using Windows batch commands, how to append immediately after the next word in the file?

When appending to a file using Windows batch commands, how to append immediately after the next word in the file? For example, these commands echo here is the date of > c:\arun.txt date /t >> c:\arun.txt write the following text to the arun.txt file: here is the date of 29-03-2010 But I want the output to be like this: ...