About 82 results
https://rednafi.com/python/unix-style-pipeline-with-subprocess/ · 14 Jul 2023
Build Unix-style command pipelines in Python using subprocess.run with stdout piping for efficient process chaining and output capture.
https://rednafi.com/python/enable-repeatable-lazy-iterations/ · 13 Jul 2023
Create reusable generators by implementing __iter__ in a class, allowing multiple lazy iterations without memory overhead or repeated function calls.
https://rednafi.com/misc/associative-arrays-in-bash/ · 3 May 2023
Learn how to use associative arrays in Bash to create key-value pairs, mimic dictionaries, and manage complex data structures in shell scripts.
https://rednafi.com/misc/process-substitution-in-bash/ · 30 Apr 2023
Use process substitution <() to treat command output as files in Bash. Compare directories, process data, and avoid temporary files with this technique.
https://rednafi.com/misc/dynamic-menu-with-select-in-bash/ · 29 Apr 2023
Build interactive CLI menus with Bash select statement. Create user-friendly command-line tools with option selection and function dispatch.
https://rednafi.com/misc/terminal-text-formatting-with-tput/ · 23 Apr 2023
Format terminal output with tput instead of ANSI codes. Set colors, bold text, underlines, and backgrounds with simple commands in shell scripts.
https://rednafi.com/python/switch-between-multiple-datastreams/ · 19 Feb 2023
Poll multiple data sources in a single thread using Python generators with itertools.cycle to alternate between infinite data streams efficiently.
https://rednafi.com/python/skip-first-part-of-an-iterable/ · 12 Feb 2023
Skip elements in iterables until a condition is met using itertools.dropwhile for efficient lazy evaluation that works with generators.
https://rednafi.com/misc/colon-command-in-shell-scripts/ · 23 Dec 2022
Use the colon : command as a no-op in Bash scripts for cleaner debug output with -x flag. Alternative to echo for section markers and comments.
https://rednafi.com/python/install-python-with-asdf/ · 13 Nov 2022
Manage multiple Python versions on macOS using asdf, a unified version manager replacing pyenv, nvm, and language-specific tools.