terminal

How do I exit VIM when doing a command line mercurial commit?

I'm on a mac running snow leopard. I have mercurial 1.1 installed. After I hit "esc" to exit insert mode I can't figure out how to save and quit. Hitting control+c shows me instructions that say typing "quit" will write and quit, but it doesn't seem to work. ...

Opening Vim and using some command in normal mode from the Terminal?

I want to be able to open Vim and automatically make some commands in normal mode (in this case, open two buffers put a mark in one line on one line, fold another line, and go to the bottom of the file). The closest thing I found would be using the -c or + command line switch, however these execute commands in Ex mode. For example, I wo...

Python in terminal

Hi. This question concerns running python files in terminal that are not stored in the home directory. I think I have solved the first bit of this puzzle by modifying my path so that it includes the directory where my python programs are stored. So where as initially echo $PATH would yield the following: /usr/bin:/bin:/usr/sbin:/sbin:...

Running command line commands within Ruby script

Is there a way to run command line commands through Ruby? I'm trying to create a small little Ruby program that would dial out and receive/send through command line programs like 'screen', 'rcsz', etc. It would be great if I could tie all this in with Ruby (MySQL backend, etc.) ...

The problem continues....please help

Here is the code: - (IBAction) charlieImputText:(id)sender { [progressBarText startAnimation:self]; charlieImputSelf = [sender stringValue]; NSAppleScript *sendCharlieImput = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell application \"Terminal\" to do shell script \"%@\"", charlieImputSelf]]; [sendCharlieIm...

Faster use of the cli - setting a variable for current project

I'm frequently using the cli (terminal) on Linux and Mac. How can I save time by setting a variable to the current project folder instead of cd path/to/folder/over/and/over/again Something like cd the-current-project (with tab completion) ? ...

open flash player and test swf from textmate

i usually write my code with textmate. a custom command for testing the proj directly in flash is: echo 'document.testMovie();' > /tmp/fc.jsfl open -a /Applications/Adobe\ Flash\ CS5/Adobe\ Flash\ CS5.app /tmp/fc.jsfl what about the flash standalone player? echo 'document.testMovie();' > /tmp/fc.jsfl open -a /Applications/Adobe\ Fla...

How can I make emacs think it is using a terminal?

I want to automate a job involving font lock mode using Emacs. I want to fontify a file and then convert it to HTML using the colouring of font lock mode. The problem is that Emacs refuses to fontify the file unless it thinks it is running in a terminal. In other words it will not fontify when running under -batch. Is there a way to fool...

Execute C program till Ctrl+C hit in the terminal

Hi, I am writing a program that repeatedly does an operation till Ctrl+C is hit by the user in the Linux terminal. I am programming in C. Any ideas how i can implement this. I have tested my program by using "for" loops with a condition but now i want to make it run as long as Ctrl+C is hit by the user and interrupted. What I was thin...

Objective c terminal application

Is there such thing? I need to make an application in Xcode to basically do what the terminal app does. With just an nstextfield as the input, a label for the terminal output, and a send button. All this needs to be done without terminal accually being open. Is this possible? If so, can someone post a website or sample code? ...

Linux(Ubuntu) Terminal-how to view previous pages not visible anymore

When you scroll up, say to see a log, the first portion of it will not be visible since the terminal only supports a limited no. of lines. So if you want to scroll up and be able to see everything, at least a few pages up, how do you do it? ...

VT100 Terminal Emulation in Windows WPF or Silverlight

I'm pondering creating a WPF or Silverlight app that acts just like a terminal window. Except, since it is in WPF/Silverlight, it will be able to 'enhance' the terminal experience with effects, images, etc. I'm trying to figure out the best way to emulate a terminal. I know how to handle the VT100 emulation as far as parsing, etc. But ...

Change all with command line

I'm wondering if there is a way to change a specific word in all of the files within the /www/ directory using command line. Just looking for a faster way to change out a specific word so I don't need to open all the files manually! Thanks! ...

Simple Terminal Command Question - Is there a command to pull a certain line out of an input?

Hey guys, I have a simple question. Is there a command that allows you to pull a certain line out of an input? Like if I wanted the 7th line from ifconfig. Is there a way to do this: ifconfig | [command] 7? Thanks! ...

How to read the commentary of a certain svn commit version using terminal?

How to read the commentary of a certain commit version using terminal? Like: svn commit_version read or something similar? ...

Using Java to call Linux terminal: How to flush the output?

Hi all: 1) I'm using Java to call Linux terminal to run foo.exe and save the output in a file: String[] cmd = {"/bin/sh", "-c", "foo >haha.file"}; Runtime.getRuntime().exec(cmd); 2) The problem is when I plan to read haha.file later in the code, it hasn't been written yet: File f=new File("haha.file"); // return true in = ne...

Run multiple commands in multiple Terminal windows with a single bash line

Here's an interesting problem: Using the AppleScript method to launch a new command in a Terminal window fails if Terminal is "busy"; more precisely, it will open a new window but fail to run the command. For example, try copy+pasting this line in: osascript -e 'tell application "Terminal" to do script "foo"'; osascript -e 'tell applica...

Can I get terminal title? (or otherwise restore old one)

Setting terminal title is easy with echo -e "\e]0;some title\007". Works with pretty much every terminal program. What I want is to set terminal title when some program starts - and restore old one when it finishes. Is this possible? ...

Help with regular expression and grep in Linux terminal.

I'm new to regular expressions and grep, but I've been trying to learn it to help me when using console tools. I have to use cvs, and when I update some files, I don't need to see files that were't updated or with *.pyc extension for example. So, I created a script that calls: cvs update -d | grep -v 'pyc$' | grep -v '^\?' First ques...

what is the c code to execute xeyes or xclock?

which function do i use to give such linux terminal calls in my c program? ...