2
голосов
2ответов
322 просмотров

graceful degradation for globbing on terminal

Whenever glob pattern match fails, it stops the whole job. For instance, $ mv *.jpg *.png folder1 && blahblah mv: cannot stat `*.jpg': No such file or directory *.png isn't moved to folder1 and blahblah is not run. And the script below works only for the case when both .[A-z]* and * s...

19
голосов
5ответов
19282 просмотров

Opening a new terminal tab in OSX(Snow Leopard) with the opening terminal windows directory path

I've been Googling for a while looking for a simple way to do this, and I can't find one. I have a custom terminal environment set up (zsh) with various aliases and functions to make things easier. One thing I keep running into is that I will quickly APPLE-t to create a new tab and then type a c...

14
голосов
2ответов
7934 просмотров

Getting Emacs to respect my default shell + options

I'm trying to get my Emacs shell to mimic that of my standard terminal sessions. Basically I would like it to respect the same PATH as well as the command prompt. So far I have a few issues: PATH isn't found, below is the fix I'm using for that. I'm getting ascii color codes all over the plac...

1
голосов
3ответов
143 просмотров

How to allow a user to edit data in a separate app from the terminal?

I am writing a terminal-based application, but I want the user to be able to edit certain text data in a separate editor. For example, if the user chooses to edit the list of current usernames, the list should open as a text file in the user's favorite editor (vim, gedit, etc.). This will proba...

497
голосов
7ответов
421226 просмотров

OS X Terminal Colors

I'm new to OS X, having just gotten a Mac after working with Ubuntu Linux for some time. Among the many things I'm trying to figure out is the absence of colors in my terminal window - like the ones that are shown (on Linux) when running ls -la or git status... I just can't figure out how to act...

0
голосов
2ответов
3413 просмотров

Cocoa/Objective-c 'system();' acting weird

I'm trying to run an applescript inside my Cocoa app using the system(); function - the string I'm passing to the function works in terminal and the applescript itself is fine, I think it has something to do with NSString - can anyone help? //add to login items NSLog(@"add to log...

3
голосов
2ответов
1092 просмотров

how to specify the terminal width in mysql CLI

I'm using the mysql CLI, however the result displays always wraps around on my terminal screen. is there any way to specify to mysql the size of my terminal screen?

35
голосов
3ответов
34414 просмотров

Selecting text in terminal without using the mouse

If I'm working in a terminal window in Linux, is there a keyboard shortcut I can use to select output displayed on previous lines? If I select something with the mouse I can copy using Ctrl + Shift + C, but is there a way to select without using the mouse at all. I'm using either Gnome terminal ...

17
голосов
5ответов
9091 просмотров

How to view git objects and index without using git

Using the OS X terminal, How an you view the contents of these files as plain text?

11
голосов
7ответов
2612 просмотров

Meta and # in a UK mac terminal

In the mac terminal application there is a setting (preferences -> keyboard) that lets you set "use option as meta key". This is useful as a lot of unix boxes use bash as default shell and that has emacs keybindings M-f and M-b that let you skip words. Problem is that on a Mac with a UK keyb...

221
голосов
7ответов
181425 просмотров

SVN Commit specific files

Is there any way to commit only a list of specific files (e.q. just one of the list of files that SVN wants to commit). I'm working on MAC OS X under Terminal, without any UI.

-1
голосов
2ответов
634 просмотров

Gnome Terminal Duplication

Very often I need two gnome-terminal sessions at the same location. Is it possible to open a single terminal, get to the directory I need, and make a duplicate of the terminal so I don't have to type in the cd command (which can get lengthy) a second time in the second window?

9
голосов
2ответов
2704 просмотров

Mac Terminal.app annoying bug - How to fix it?

Video showing the problem: http://www.mentaframework.org/download/TerminalBug.mov When I am typing on the Terminal.app and reach the end of the line, the next line starts on top of the first line, overwriting everything. Then if I use the delete key everything messes up and disappears. I did a...

0
голосов
1ответов
1213 просмотров

connect to MYSQL from PHP via terminal

I'm trying to connect to my localhost MySQL server via php in the terminal. It's outputting that it cannot connect to the host through my socket. My PHP ini install says this MYSQL_SOCKET /tmp/mysql.sock so i used mysql_connect("/tmp/mysql.sock","root","",""); And I get errors Any sugg...

1
голосов
3ответов
2988 просмотров

How to get/set the console cursor position in Ruby (Windows)

I'm trying to write a shell in Ruby, and to implement tab completion I am using the WinAPI function getch to read in a character at a time from the user, checking for tabs. The problem with this is the backspace key: It moves the cursor further back than the prompt (eg, with prompt hello>,...

1
голосов
5ответов
882 просмотров

Used MacPorts to install WordPress. Where is it now?

I used MacPorts shell to download and install WordPress: port install wordpress It went just fine: ---> Computing dependencies for libxml2 ---> Fetching libxml2 ---> Attempting to fetch libxml2-2.7.5.tar.gz from http://arn.se.distfiles.macports.org/libxml2 ---> Verifying chec...

1
голосов
6ответов
2697 просмотров

I want to show off my C++ projects through a website

The problem is that, well, it's C++. The way I've created them makes it such that they've always been run via a terminal/console window and wait for user input or else simply take a sample input and run with that. The output has also always been to the terminal screen or sometimes to a file. I...

17
голосов
5ответов
33993 просмотров

Writing unicode strings via sys.stdout in Python

Assume for a moment that one cannot use print (and thus enjoy the benefit of automatic encoding detection). So that leaves us with sys.stdout. However, sys.stdout is so dumb as to not do any sensible encoding. Now one reads the Python wiki page PrintFails and goes to try out the following code: ...

68
голосов
11ответов
121352 просмотров

Using 'make' on OS X

I have a MacBook Pro that I'm trying to do some development on. I have a program I want to build, and when I went to use make to build it, I got a "command not found" error. I did some googling and Stack Overflow searches and it doesn't look like this is a common problem. Why don't I have make i...

0
голосов
1ответов
358 просмотров

How can I make Twitter from the terminal display Hebrew characters correctly?

I've been using the Perl solution for Twitter via Terminal: IRSSI + TWIRSSI for the past couple of days. Amazing. The feeling so nostalgic yet so futuristic; beautiful. However, one problem still stands: Hebrew letters result as gibberish: Any idea how or where to I can modify the script to wo...

4
голосов
4ответов
2218 просмотров

How to see what label color is on a file/folder from within Termnal (Mac OS X)

I want to include in a script a check for a file input to see if the file/folder has a color set and if it does, which one... (I don't need help with the creation of this script, just need the command to check what color the label is). eg, like these colors (grey): http://img.skitch.com/20090923...

38
голосов
3ответов
46648 просмотров

ldconfig equivalent in Mac OS X?

Is there a parallel command to Linux's LDCONFIG for Mac OS X's Terminal?

9
голосов
5ответов
4286 просмотров

Open a terminal window to a specified folder from a Cocoa app

I have seen this thread on how to execute terminal commands from within a Cocoa app. But I want to actually launch Terminal.app to a specified directory. I know that the following does not work: [[NSWorkspace sharedWorkspace] openFile:folderPath withApplication:@"Terminal"]; Terminal tries to...

1
голосов
3ответов
11193 просмотров

BusyBox Help, ip Command

I'm using a Google phone running Android, and I need to figure out how to use the terminal's 'ip' command. I found out that Android uses BusyBox in its terminal, but I can't find any help or tutorials or any information regarding it other than the basic information given in the terminal help. ...

5
голосов
3ответов
2240 просмотров

Bash - $PATH and ${PATH}

What is the difference between using an environment variable, like PATH, as $PATH or ${PATH}?

1
голосов
5ответов
1847 просмотров

Post to Twitter using Terminal with CURL

I got this far: :~ curl -u username:password -d status="new_status" http://twitter.com/statuses/update.xml Now, how can I alias this with variables so I can easily twit from Terminal? How can I make the alias working through different sessions (when I close Terminal aliases reset). Thanks!

21
голосов
3ответов
16787 просмотров

Receiving key press and key release events in Linux terminal applications?

I would like to write a simple C program that will perform different actions based on both "key down" and "key up" events. This program will be run from inside rxvt. What library or mechanism should I use to access both key presses and releases? Is it true that reading /dev/tty will only provide...

42
голосов
5ответов
9927 просмотров

How can I check if a Java program's input/output streams are connected to a terminal?

I would like a Java program to have different default settings (verbosity, possibly colored output where supported) depending on its use. In C, there is an isatty() function which will return 1 if a file descriptor is connected to a terminal, and 0 otherwise. Is there an equivalent for this in Ja...

149
голосов
9ответов
50801 просмотров

How to trick an application into thinking its stdout is a terminal, not a pipe

I'm trying to do the opposite of "Detect if stdin is a terminal or pipe?". I'm running an application that's changing its output format because it detects a pipe on STDOUT, and I want it to think that it's an interactive terminal so that I get the same output when redirecting. I was thinking th...

2
голосов
4ответов
2857 просмотров

apt like column output - python library

Debian's apt tool outputs results in uniform width columns. For instance, try running "aptitude search svn" .. and all names appear in the first column of the same width. Now if you resize the terminal, the column width is adjusted accordingly. Is there a Python library that enables one to do t...