The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lp command can't change cpi mountainwater HP-UX 3 05-13-2008 04:54 AM
need command to change permissions calredd UNIX for Dummies Questions & Answers 1 04-28-2007 09:53 AM
SED command to change ./ to a space bobk544 Shell Programming and Scripting 11 04-05-2007 05:46 AM
How to change blocksize for in tar command KhawHL UNIX for Dummies Questions & Answers 10 11-10-2006 07:04 PM
Change directory command (cd) oscarr Shell Programming and Scripting 4 08-23-2002 05:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 05-15-2007
Registered User
 

Join Date: May 2007
Posts: 2
how to change something is a command?

Using !! or !x we can repeat previous command. If I want to repeat the command with something changed, what do I do? Say,

The prev. command
cat a.txt | grep "pp" > a.out

The new command
cat b.txt | grep "pp" > b.out

Is there a short way?
Reply With Quote
Forum Sponsor
  #2  
Old 05-15-2007
Shell_Life's Avatar
Registered User
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
If you are in the unix prompt, typing the escape key will allow you to review
your previous commands as you are using "vi".
You can start with "k" to go back to each command.
Is this what you are referring to?
Reply With Quote
  #3  
Old 05-15-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
what is the os and shell you are using ?
Reply With Quote
  #4  
Old 05-15-2007
Registered User
 

Join Date: May 2007
Posts: 2
Quote:
Originally Posted by matrixmadhan
what is the os and shell you are using ?
It's cygwin, like unix c-shell.
Reply With Quote
  #5  
Old 05-22-2007
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
With csh,

% cat a.txt | grep "pp" > a.out
% ^a^b
cat b.txt|grep "pp" > a.out
%
Note that it changes the first occurance, not all occurances. I don't know if there is a way to change all occurances.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0