Tag Archives: bash

coprocesses in bash using dc as an example

Coprocesses are a feature of bash which allow you to communicate with the stdin and stdout of a subprocess. I illustrate this by having a bash script to interact with “dc”, the arbitrary precision calculator, to sum up a sequence … Continue reading

Posted in Computers, Uncategorized | Tagged , , | Leave a comment

Bash script for selecting tmux session

Problem You want to list and select from several available tmux sessions Solution If necessary, install iselect: sudo apt-get install iselect Create an executable script called tsel: #!/usr/bin/env bash CHOICE=`tmux ls | iselect -a` [[ ${#CHOICE} == 0 ]] && … Continue reading

Posted in Computers | Tagged , , , , | Leave a comment

A directory quick-change script in bash

It is convenient to have mnenomic names for favourite directories so that you can change to them quickly. ‘cdargs’ is a directory bookmarking utility that I use quite often, but I find that it can become cluttered, and difficult to … Continue reading

Posted in Computers | Tagged , , | Leave a comment