Kickstart has asked for the wisdom of the Perl Monks concerning the following question:
$pattern = $ARGV[0]; @list = `grep $pattern $HOME/.bash_history`; @list = reverse @list; foreach $command (@list) { chomp $command; print "$command (Y/N)?"; $choice = <STDIN>; if ($choice =~ 'Y' || $choice =~ 'y') { $foo = `$command`; print "$foo\n"; exit; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: command recall
by ahunter (Monk) on Feb 12, 2001 at 14:53 UTC | |
|
Re: command recall
by jynx (Priest) on Feb 13, 2001 at 02:05 UTC | |
by Kickstart (Pilgrim) on Feb 13, 2001 at 04:13 UTC |