Skip to content

Instantly share code, notes, and snippets.

@davepagurek
Last active October 10, 2017 04:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davepagurek/f0a1a5e2a9371b62cd6f716bbe47f870 to your computer and use it in GitHub Desktop.
Save davepagurek/f0a1a5e2a9371b62cd6f716bbe47f870 to your computer and use it in GitHub Desktop.
Add arrow keys to db2. Run `db2c`
#!/usr/bin/env bash
# install rlwrap
cd ~
git clone https://github.com/hanslub42/rlwrap.git
cd rlwrap
autoreconf --install
./configure --prefix=$HOME
make
make install
# add bash shortcuts
echo 'export PATH="$PATH:~/bin"' >> ~/.bashrc
echo 'alias db2c="rlwrap db2"' >> ~/.bashrc
source ~/.bashrc
@dongyuzheng
Copy link

Might have to use ~/.profile instead
Also: alias db2c='source ~db2inst2/sqllib/db2profile && rlwrap db2' so you don't have to source everytime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment