Forenkle arbeidsdagen med rlwrap
Et av mine favorittprogram er rlwrap. Det programmet “pakker” jeg inn i andre programmer hvor jeg ønsker at pil-tastene skal anvendes for enkel redigering av teksten.
Hvis du arbeider på Ubuntu Linux finnes pakken ferdig kompilert, da er det bare å laste ned programmet:
oracle@ubuntu: ~ $ sudo apt-get install rlwrap
...
For de fleste andre Linux og Unix varianter må du først søke på Google etter rlwrap og laste ned kildekoden.
[oracle@linux tmp]$ tar xvzf rlwrap-0.30.tar.gz
rlwrap-0.30/
rlwrap-0.30/completions/
rlwrap-0.30/completions/ftp
...
[oracle@linux tmp]$ cd rlwrap-0.30
/tmp/rlwrap-0.30
[oracle@linux rlwrap-0.30]$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
...
config.status: creating distribution/rlwrap.spec
config.status: creating config.h
config.status: executing depfiles commands
Now do:
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it
[oracle@linux rlwrap-0.30]$ make
make all-recursive
make[1]: Entering directory `/tmp/rlwrap-0.30'
Making all in doc
/tmp/rlwrap-0.30/doc
make[2]: Entering directory `/tmp/rlwrap-0.30/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/tmp/rlwrap-0.30/doc'
Making all in src
[oracle@linux rlwrap-0.30]$ sudo make install
Password: ######
Making install in doc
/tmp/rlwrap-0.30/doc
make[1]: Entering directory `/tmp/rlwrap-0.30/doc'
make[2]: Entering directory `/tmp/rlwrap-0.30/doc'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/man/man1" || /bin/mkdir -p "/usr/local/share/man/man1"
/usr/bin/install -c -m 644 './rlwrap.1' '/usr/local/share/man/man1/rlwrap.1'
make[2]: Leaving directory `/tmp/rlwrap-0.30/doc'
make[1]: Leaving directory `/tmp/rlwrap-0.30/doc'
Making install in src
/tmp/rlwrap-0.30/src
make[1]: Entering directory `/tmp/rlwrap-0.30/src'
make[2]: Entering directory `/tmp/rlwrap-0.30/src'
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
/usr/bin/install -c 'rlwrap' '/usr/local/bin/rlwrap'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/tmp/rlwrap-0.30/src'
make[1]: Leaving directory `/tmp/rlwrap-0.30/src'
make[1]: Entering directory `/tmp/rlwrap-0.30'
make[2]: Entering directory `/tmp/rlwrap-0.30'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/rlwrap" || /bin/mkdir -p "/usr/local/share/rlwrap"
/usr/bin/install -c -m 644 'completions/ftp' '/usr/local/share/rlwrap/ftp'
/usr/bin/install -c -m 644 'completions/testclient' '/usr/local/share/rlwrap/testclient'
/usr/bin/install -c -m 644 'completions/coqtop' '/usr/local/share/rlwrap/coqtop'
make[2]: Leaving directory `/tmp/rlwrap-0.30'
make[1]: Leaving directory `/tmp/rlwrap-0.30'
[oracle@linux rlwrap-0.30]$ which rlwrap
/usr/local/bin/rlwrap
Muligens må du laste ned fler biblioteker for å få rlwrap til å kompilere.
[oracle@linux tmp]$ tar xvzf readline-5.2.tar.gz
readline-5.2/
readline-5.2/doc/
readline-5.2/doc/Makefile.in
...
[oracle@linux readline-5.2]$ cd readline-5.2
/tmp/readline-5.2
[oracle@linux readline-5.2]$ ./configure
[oracle@linux readline-5.2]$ make
[oracle@linux readline-5.2]$ sudo make install
[oracle@linux readline-5.2]$ sudo ldconfig
Legg inn noen alias i for eksempel .bashrc så er rlwrap inkludert i de programmene du bruker hver dag.
ingemar@linux: ~ $ cd
ingemar@linux: ~ $ vi .bashrc
alias sql='sqlplus "/ as sysdba"'
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias dgmgrl='rlwrap dgmgrl'
alias boston='. ~/.boston'
alias chicago='. ~/.chicago'
alias emrep='. ~/.emrep'
alias test10g='. ~/.test10g'
alias test11g='. ~/.test11g'
alias ll='ls -ltr'
Da er det bare å teste hvordan dine program fungerer.
Lykke til!
This post is also available in: English
English
Norsk 