DEV Community

Discussion on: Bash: Edit command in your editor and execute directly

Collapse
 
victoryarema profile image
Victor Yarema • Edited

The article is great. I started to use vim to edit long scripts now. I was "suffering" with emacs mode in zsh before.
But regarding your example with poolfetch. I would do it compltely different. Here's an example:

seq 4 | xargs -n1 bash -c 'poolfetch -g $1.esp32' -
Enter fullscreen mode Exit fullscreen mode

You can even add -P 32 for example if you want to run at most 32 parallel jobs. Obviously in current example it will trigger just 4 parallel jobs. One of few things to beware in such case is that all the outputs from parallel jobs will interleave and it can be messy.