• some_guy@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    20 hours ago

    I have a ~/.dotfiles/functions/ directory full of bash functions that do all sorts of handy things. I also have an alias to re-source my shell set to src to make changes to everything speedy, which the author should do something similar. Here’s the contents, from which you can suss some of what they do:

    cd        die       funcinfo  kbase     mkcd      prinfo    rule      spinner
    cdd       duc       gcl       lkp       myip      psh       rulem     szh
    cdf       durh      getip     lsp       oscheck   rederr    server    szup
    console   fk        hgr       lspx      pfetch    rmhost    shc       usage
    count     fp        int       mcat      phed.sh   rotl      shebang   version
    date      fpr       j2        menu      phpserver rotr      shgrep    xcpx
    

    shebang, for example, creates a new file with a header (#!/usr/bin/env bash) and then two carriage-returns in vim so I can start a new script from the cli.

    All of these are something I thought would be useful at the time I created them, even if I only rely on a small number daily. Some of them are relied upon when scripting and never used at the cli independently. I started doing this when reading Pro Bash Programming, by Chris F. A. Johnson.