serhii.net

In the middle of the desert you can say anything you want

20 Jun 2024

Fish shell bits

Run and disown

In my old zsh config I had this:

function dos() {
    # run_disowned and silenced
    nohup "$@" >/dev/null 2>&1 & disown
}

Emulating my old dos command in fish:

Both together give this solution:

function dos
  echo "disowning $argv"
  command $argv  >/dev/null 2>&1 &
  disown
end

Shell notation for $(cmd)

shell - Fish equivalent of bash $(command) notation - Stack Overflow: - bash: $(command) - fish: (command)

which command

type - locate a command and describe its type — fish-shell 3.7.0 documentation: type commandname.

[I] sh@nebra~/me/me-qs $ type cc
cc is a function with definition
# Defined in /home/sh/.config/fish/config.fish @ line 184
function cc
  echo ">>> $argv"
  command python3 -c "from math import *; from statistics import *; print($argv);"
end
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus