Sponsored Content
Full Discussion: Mimic bash history behavior
Top Forums Shell Programming and Scripting Mimic bash history behavior Post 86385 by sysera on Thursday 13th of October 2005 04:48:01 PM
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
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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
Goo::Canvas::Polyline(3pm)				User Contributed Perl Documentation				Goo::Canvas::Polyline(3pm)

NAME
Goo::Canvas::Polyline - wrapper for GooCanvasPolyline HIERARCHY
Glib::Object +----Goo::Canvas::ItemSimple +----Goo::Canvas::Polyline INTERFACES
Goo::Canvas::Item METHODS
item = Goo::Canvas::Polyline->new ($parent, $close_path, $points, ...) o $parent (Goo::Canvas::Item) o $close_path (boolean) o $points (arrayref) The points is an array reference that contains a flat points coordinates. If you want create a polyline without points, pass an empty array refer or undef. o ... (list) item = Goo::Canvas::Polyline->new_line ($parent, $x1, $y1, $x2, $y2, ...) o $parent (Goo::Canvas::Item) o $x1 (double) o $y1 (double) o $x2 (double) o $y2 (double) o ... (list) PROPERTIES
'arrow-length' (double : default 5 : readable / writable) The length of the arrows, as a multiple of the line width 'arrow-tip-length' (double : default 4 : readable / writable) The length of the arrow tip, as a multiple of the line width 'arrow-width' (double : default 4 : readable / writable) The width of the arrows, as a multiple of the line width 'close-path' (boolean : default false : readable / writable) If the last point should be connected to the first 'end-arrow' (boolean : default false : readable / writable) If an arrow should be displayed at the end of the polyline 'height' (double : default 0 : readable / writable) The height of the polyline 'points' (Goo::Canvas::Points : default undef : readable / writable) The array of points 'start-arrow' (boolean : default false : readable / writable) If an arrow should be displayed at the start of the polyline 'width' (double : default 0 : readable / writable) The width of the polyline 'x' (double : default 0 : readable / writable) The x coordinate of the left-most point of the polyline 'y' (double : default 0 : readable / writable) The y coordinate of the top-most point of the polyline SEE ALSO
Glib::Object, Goo::Canvas::ItemSimple COPYRIGHT
Copyright (C) 2011 Gtk2-Perl Team perl v5.14.2 2011-11-16 Goo::Canvas::Polyline(3pm)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy