developer

How to define hash tables in Bash?

Question: ❓❓❓ What is the equivalent of Python dictionaries but in Bash (should work across OS X and Linux). Good Answer: 👌👌👌 Bash 4 Bash 4 natively supports this feature. Make sure your script’s hashbang is #!/usr/bin/env bash or #!/bin/bash or anything else that references bash and not sh. Make Read more…

By admin, ago
developer

ls command: how can I get a recursive full-path listing, one line per file?

Question: ❓❓❓ How can I get ls to spit out a flat list of recursive one-per-line paths? For example, I just want a flat listing of files with their full paths: /home/dreftymac/. /home/dreftymac/foo.txt /home/dreftymac/bar.txt /home/dreftymac/stackoverflow /home/dreftymac/stackoverflow/alpha.txt /home/dreftymac/stackoverflow/bravo.txt /home/dreftymac/stackoverflow/charlie.txt ls -a1 almost does what I need, but I do not want Read more…

By admin, ago