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
Command similar to doskey halel UNIX for Dummies Questions & Answers 4 05-16-2006 04:49 AM
DOSKEY jimwelch4 UNIX for Dummies Questions & Answers 2 11-30-2000 04:36 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 02-26-2003
Registered User
 

Join Date: Jul 2002
Location: new york
Posts: 1,025
in BASH when enabled you can use the up arrow keys to view your previously entered commands, and also BASH and other shells have an auto-complete featue, in bach you just hit tab and it will either complete your command or give you a list of commands. i like bash's features better than DOSKEY when i used DOS.
Forum Sponsor
  #9  
Old 02-27-2003
yls177
Guest
 

Posts: n/a
my shell is csh
i did a set and got the below

histfile /home/adm/.history
history 100

i did a ls -ltr /home/adm/.history but it was empty.

what else do i need to set?
  #10  
Old 02-27-2003
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Read the man page for csh - search for savehist.

Set your history in your .login in your home directory.

set history=200

logout and log back in (or start a new session) - type history at the prompt. Do a couple of commands and try the history command again. See if it's changed.

As far as what you wanted to do:
Quote:
what i want is to
1) capture this history of commands into a file,
2) something like pressing esc and - to screen through the list of commands.
3) do the above in csh, sh.
History can be done in csh but not in sh. You won't be able to use Esc - or anything else in csh to list commands unless you change the history subsitution characters. Again, read the man page on csh and look for histchars.

I did not find "histfile" anywhere and if set, does not do a thing.
Try the savehist which can be found in the csh man page. Then you should see your .history start to grow (if you set it correctly).
  #11  
Old 02-27-2003
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Just an FYI to above, bash can do either history type, as can some vrsions of ksh.

bash default is the same as entering "set -o emacs".
You can get the vi editing mode on bash by entering "set -o vi".
  #12  
Old 02-27-2003
criglerj's Avatar
Registered User
 

Join Date: May 2002
Location: Atlanta
Posts: 129
Lightbulb The most flexible of all

The most flexible shell of all wrt user input/command recall and much more besides is zsh.
  #13  
Old 02-27-2003
yls177
Guest
 

Posts: n/a
i did a man csh, but did not read/find any savehist at all.
please advise.

the set history=200 in .login works.. but now i hoped to get it to write
to a file.
  #14  
Old 02-27-2003
yls177
Guest
 

Posts: n/a
set history=200
set histfile=$HOME/.history
set savehist=200 merge


put the above in .login and it will work!

cheers....


okay, will try to achieve the same for sh...
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:41 PM.


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