Visit Our UNIX and Linux User Community

ctrl-o in bash on os X leopard -- how does it work exactly?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ctrl-o in bash on os X leopard -- how does it work exactly?
# 1  
Old 07-07-2009
ctrl-o in bash on os X leopard -- how does it work exactly?

I'm going through "learning the bash shell" by newham and rosenblatt. I'm trying to ctro-O to execute and then go on to the next command in the history list, ctrl-o again, etc. (I'm just trying to get a feel for it in case I want to use it). But ctrl-o does nothing. Can someone help me out as to what I'm doing wrong?

And what does it mean when it says that the ! key Starts a history substitution?
# 2  
Old 07-08-2009
Try this for the mysterious ! :
[1] key in a bunch of commands; say 5 commands
[2] type 'history'
[3] now type '!'

see what happens, and then play with options/arguments to !

Good luck!
# 3  
Old 07-08-2009
I tried that, and when I typed ! I got this message:

-bash: syntax error near unexpected token `newline'

Can you explain what is meant by ! being a builtin command? I have to say these man pages aren't the easiest to understand -- is there some kind of book that can tell me how to decipher them? Smilie How do I know what arguments there are for the command?
# 4  
Old 07-08-2009
Built-in commands are commands included within the shell itself. Take a look @ Bash Reference Manual.

For info about ! expansion: Bash Reference Manual
# 5  
Old 07-08-2009
What I meant to ask is: does the ! by itself do anything? It was included in the list of event designators in my book, separately, followed by other arguments (like !n, for example).
# 6  
Old 07-08-2009
No, it doesn't do anything by itself. It needs arguments afaik. Apologize for not being clear about this earlier.

Previous Thread | Next Thread
Test Your Knowledge in Computers #547
Difficulty: Medium
unary operators only operate on universal variables.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies

2. UNIX for Dummies Questions & Answers

Ctrl-V + Ctrl-J for newline character does not work inside vi editor

Hi friends, I am trying to add a newline char ('\n') between the query and the commit statement in the following shell script. #! /bin/sh echo "select * from tab; commit;" > data.sql I have tried typing in "Ctrl-V + Ctrl-J" combination which has inserted ^@ (NUL) character but the commit... (1 Reply)
Discussion started by: royalibrahim
1 Replies

3. Shell Programming and Scripting

ctrl-c in bash script - Programming

Hi All, I need to place a ctrl-c interrupt in a bash script, there is no other way, it has to be done :) can someone please advise how would I go about this? i want to use ctrl c in below code, after the code excution of just 1 min or 1sec java Cspsamp 7025 rd1... (6 Replies)
Discussion started by: aish11
6 Replies

4. UNIX for Dummies Questions & Answers

Ctrl-enter doesn't work when running Midnight Commander in xterm

When running MC in xterm or gnome-terminal, it doesn't seem to allow the use of Ctrl-enter and Ctr-shift-enter to copy marked files to the command line. Does anyone know of another way to cause this to happen or a way to enable it under xterm/gnome-term? With thanks, Narnie (0 Replies)
Discussion started by: Narnie
0 Replies

5. UNIX for Dummies Questions & Answers

alias in bash shell for CTRL + l

Is it possible to create an alias wherein it will use a keystroke. Like to clear the screen in bash i have to use CTRL + l. I want to make an alias 'c' out of this. Thanks. (6 Replies)
Discussion started by: or_knob
6 Replies

6. UNIX for Dummies Questions & Answers

CTRL/C does not work

Hi My CTRL/C does not work thought the STTY setting looks Ok Appreciate your assistance $stty -a speed 38400 baud; rows = 24; columns = 80; ypixels = 0; xpixels = 0; eucw 1:0:0:0, scrw 1:0:0:0 intr = ^c; quit = ^\; erase = ^?; kill = ^u; eof = ^d; eol = <undef>; eol2 = <undef>;... (10 Replies)
Discussion started by: zam
10 Replies

7. UNIX for Dummies Questions & Answers

Bash Location in Leopard

Hi, Where is bash located in Leopard? According O'Reilly's "Bash Cookbook" Mac OS 10.2 and newer ship with bash as /bin/sh. But I checked and there is a /bin/bash. Which would I use in my shebang when writing BASH scripts? Mike (2 Replies)
Discussion started by: msb65
2 Replies

8. UNIX for Dummies Questions & Answers

ctrl+S resulting in (i-search) in bash

Hi On solaris, when I press Ctrl+S on an XTERM, the window normally freezes. But today on the same machine, the Ctrl+S key results in (i-search) !! I understand that it has got something to do with emacs (may be not). But I do not use emacs at all. Other specific keys including <backspace>,... (3 Replies)
Discussion started by: balaji280283
3 Replies

9. AIX

Disable ctrl-c,ctrl-d,ctrl-d in ksh script

I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt :confused: (6 Replies)
Discussion started by: wtofu
6 Replies

10. UNIX for Dummies Questions & Answers

my ctrl+c doesn't work

it seams that my ctrl+c and my ctrl+d don't work. if I type a bunch of jiberish on a line and ctrl+c I expect the command to be cancelled and to be given a fresh prompt, but instead it just putts ^C at the end of the line. Also, ctrl+d should close the session, but instead mine just puts ^D at... (3 Replies)
Discussion started by: yankee428
3 Replies

Featured Tech Videos