Shell scripts with Fn
    Dan Nelson 
    dnelson at allantgroup.com
       
    Wed May 21 07:35:51 PDT 2003
    
    
  
In the last episode (May 21), Fabian Haidekker said:
> I wonder if I can execute self-written shell scripts by pressing one
> of the Fn keys? I am using Freebsd 5 and know how to change
> characters on my keymap, but need some help putting shell commands at
> certain keys if possible...
Depends on where you want the change.  You can remap the F-keys with
kbdcontrol, but they will not be useable as regular function keys in
any program anymore.  If your shell supports keybindings, you can bind
whatever you want to the F-keys in the shell, which won't affect other
programs.  Under zsh, for example, this makes the F1 key run the
command 'ls -ltr':
bindkey -s $termcap[k1] "ls -ltr^m"
Under /bin/sh, the syntax is similar, but you'll need to know the key's
escape code:
bind -s "\e[M" "ls -ltr^m"
-- 
	Dan Nelson
	dnelson at allantgroup.com
    
    
More information about the freebsd-questions
mailing list