Mimic bash history behavior


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mimic bash history behavior
# 1  
Old 10-13-2005
Mimic bash history behavior

Does anyone know of a way to mimic the up arrow/down arrow type bash behavior within a shell script?

Say I have a scripted menu, and would like to be able to up arrow to bring up the last X number of lines of user input?

Thanks to anybody with a suggestion. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Different behavior between bash shell and bash script for cmd

So I'm trying to pass certain json elements as env vars and use them later on in a script. Sample json: JSON='{ "Element1": "file-123456", "Element2": "Name, of, company written in, a very weird way", "Element3": "path/to/some/file.txt", }' (part of the) script: for s... (5 Replies)
Discussion started by: da1
5 Replies

2. Shell Programming and Scripting

Cannot mimic the action of 'echo' with C

I realise this is not entirely a shell question because it involves the C language but it centers around a Bash script I have written. I have written a couple of bash script files that communicate via two serial ports. One script can be thought of as a receiver and the other as a transmitter.... (3 Replies)
Discussion started by: jjb
3 Replies

3. UNIX for Advanced & Expert Users

Bash : While Loop behavior

Good Morning I think there may be something I dont understand fully. The following code works well, but I dont like the set domen method. #!/bin/bash # domen="y" while do echo " M A I N - M E N U" echo "1. Contents of /etc/passwd" echo "2. List of users currently logged" echo... (10 Replies)
Discussion started by: popeye
10 Replies

4. UNIX for Advanced & Expert Users

unexpected behavior bash, set -o vi, history -a, and HISTFILE

I am trying to get my history in sync in multiple bash sections and things aren't working the way I expect. Desired behavior, hitting esc-K in all bash sessions (same userid and machine) will use the same history. Observed behavior: Esc-k shows the history of the current session, rather than... (8 Replies)
Discussion started by: gg48gg
8 Replies

5. Shell Programming and Scripting

bash history buffer cache

Moderators, Please excuse if I am in the wrong section. I have a question that someone may know the answer to. We know that a current bash shell keeps a record of all commands in a buffer. When the shell is terminated this buffer is written out to ~/.bash_history for the user. I know... (2 Replies)
Discussion started by: jaysunn
2 Replies

6. UNIX for Advanced & Expert Users

Different redirection behavior in BASH/Linux when run under cron vice login ???

run_xfs_fsr is a xfs filesystem maintenance script designed to run under cron. The system is a home theater personal computer running mythbuntu 10.10, and is accessed remotely for these tests. cron runs a script, (xfs_fsr.sh) at 02:30 that runs the subject script under BASH and sets the... (3 Replies)
Discussion started by: keepitsimpleeng
3 Replies

7. Red Hat

BASH command not found strang behavior

Hi all I am relatively new to linux (specifically red hat). I have installed Fedora 13 on my machine and started playing with the terminal when i found a very strange behavior when typing a command that is not found: the terminal does not prompt me back. In other words, i am logged as root (or... (4 Replies)
Discussion started by: abohmeed
4 Replies

8. UNIX for Dummies Questions & Answers

AIX bash history recall

Is it possible to use the keyboard UP ARROW in place of k to recall history? If so, how/what do I need to do change terminal emulation, etc.? TIA, George (7 Replies)
Discussion started by: gwfay
7 Replies

9. Shell Programming and Scripting

BASH quoting behavior

The block below isn't a surprise:$ ls file1 file2 file3 $ x=* $ echo $x file1 file2 file3 $ echo '$x' $x $ echo "$x" * $But I found this block a bit bewildering:$ echo $x' >' * $I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell).... (5 Replies)
Discussion started by: na5m
5 Replies
Login or Register to Ask a Question
Gtk2::Arrow(3)						User Contributed Perl Documentation					    Gtk2::Arrow(3)

NAME
Gtk2::Arrow HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Misc +----Gtk2::Arrow INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS
widget = Gtk2::Arrow->new ($arrow_type, $shadow_type) o $arrow_type (Gtk2::ArrowType) o $shadow_type (Gtk2::ShadowType) $arrow->set ($arrow_type, $shadow_type) o $arrow_type (Gtk2::ArrowType) o $shadow_type (Gtk2::ShadowType) PROPERTIES
'arrow-type' (Gtk2::ArrowType : readable / writable / private) The direction the arrow should point 'shadow-type' (Gtk2::ShadowType : readable / writable / private) Appearance of the shadow surrounding the arrow ENUMS AND FLAGS
enum Gtk2::ArrowType o 'up' / 'GTK_ARROW_UP' o 'down' / 'GTK_ARROW_DOWN' o 'left' / 'GTK_ARROW_LEFT' o 'right' / 'GTK_ARROW_RIGHT' o 'none' / 'GTK_ARROW_NONE' enum Gtk2::ShadowType o 'none' / 'GTK_SHADOW_NONE' o 'in' / 'GTK_SHADOW_IN' o 'out' / 'GTK_SHADOW_OUT' o 'etched-in' / 'GTK_SHADOW_ETCHED_IN' o 'etched-out' / 'GTK_SHADOW_ETCHED_OUT' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Misc COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::Arrow(3)