diff options
author | bobpaul | 2018-03-30 11:28:17 -0500 |
---|---|---|
committer | bobpaul | 2018-03-30 11:28:17 -0500 |
commit | 5e4d6006fb5f07d756c0e7ab12de2e1712ccc468 (patch) | |
tree | 64ffb223c0f9078023d357386efa62d672256e5b /sl | |
download | aur-sl-alt.tar.gz |
Initial commit
Diffstat (limited to 'sl')
-rw-r--r-- | sl | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +#!/bin/bash +# sl - prints a mirror image of ls. (C) 2017 Tobias Girstmair, https://gir.st/, GPLv3 + +LEN=$(ls "$@" |wc -L) # get the length of the longest line + +ls "$@" | rev | while read -r line +do + printf "%${LEN}.${LEN}s\\n" "$line" | sed 's/^\(\s\+\)\(\S\+\)/\2\1/' +done |