Created
July 11, 2022 11:24
-
-
Save mspreij/1811890fa632e208f33ec57ef55c7012 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lpath () | |
{ | |
if [[ -z $1 ]]; then | |
echo " E: expected path"; | |
echo " lpath shows permissions, user, group for each part of a given path to file or directory (with ls -lad)"; | |
return 1; | |
fi; | |
local path=${1#/}; | |
local oldIFS="$IFS"; | |
IFS='/'; | |
local whole=''; | |
local output=''; | |
for part in $path; | |
do | |
whole=$whole/$part; | |
output="$output | |
$(command ls -lad "$whole")"; | |
done; | |
echo "$output" | column -t; | |
IFS="$oldIFS" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment