July 12, 2024

Pass the output of french-conjugator (verbiste’s cli) to less

This function will pass the output of french-conjugator to less:

# pass output of french-conjugator to less
function con() {            # define function 'con'
    french-conjugator "$@" \    # pass the argument '$@' to the command 'french-conjugator'
    2>&1  \             # redirect standard error, i.e. 2, to standard output, i.e. 1 
    | \                 # sends the output of the command 'french-conjugator' (to less)
    less --quit-if-one-screen   # prints input to less; the option causes less to exit if output can be display on the first screen 
}

You can copy this to .bashrc:

# pass output of french-conjugator to less
 function con() {
    french-conjugator "$@" 2>&1 | \
    less --quit-if-one-screen
}

Now, run $ con verb to display conjugation.

To install french-conjugator run:

$ sudo apt install verbiste

personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki verbiste offline

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88