The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-27-2007
ilak1008 ilak1008 is offline
Registered User
  
 

Join Date: May 2005
Posts: 64
!! for ksh

Like C-Shell, is there a shortcut command for !! in Korn Shell? I tried to search the forum but no luck.
  #2 (permalink)  
Old 05-27-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Run ksh in vi mode (set -o vi), and use ESC-k. That will allow you to go through the command history.
  #3 (permalink)  
Old 05-27-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
You may find the "r" alias does this, if you don't have the r alias, alias it yourself:
Code:
$ alias r='fc -e -'
$ pwd
/some/path
$ r
pwd
/some/path
Cheers
ZB
  #4 (permalink)  
Old 05-27-2007
ilak1008 ilak1008 is offline
Registered User
  
 

Join Date: May 2005
Posts: 64
Thanks Gentlemen!
  #5 (permalink)  
Old 05-27-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,190
Quote:
Originally Posted by zazzybob
You may find the "r" alias does this, if you don't have the r alias, alias it yourself:
Code:
$ alias r='fc -e -'
$ pwd
/some/path
$ r
pwd
/some/path
Cheers
ZB
If you really want it to be !! you could also do:
Code:
alias !!='fc -e -'
  #6 (permalink)  
Old 05-28-2007
ilak1008 ilak1008 is offline
Registered User
  
 

Join Date: May 2005
Posts: 64
Quote:
Originally Posted by reborg
If you really want it to be !! you could also do:
Code:
alias !!='fc -e -'
Thanks reborg!
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0