diff options
author | garhve <git@garhve.com> | 2022-12-05 19:43:39 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2022-12-05 19:43:39 +0800 |
commit | c6bc541ab58363d783e60a007e80e9bf9e231fda (patch) | |
tree | a59c7ed0d05225c5876f3e5e919d4f6ed0c447ff /bash/list_all_file.sh |
initialize
Diffstat (limited to 'bash/list_all_file.sh')
-rwxr-xr-x | bash/list_all_file.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bash/list_all_file.sh b/bash/list_all_file.sh new file mode 100755 index 0000000..c9d8831 --- /dev/null +++ b/bash/list_all_file.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +###################################################################### +# @author : Garhve (garhve@gmail.com) +# @file : p +# @created : Friday Nov 04, 2022 19:22:17 CST +# +# @description : +###################################################################### + + +function list() { + for x in "$1"/*; do + if [ -d "$x" ]; then + echo "$x"; + list "$x" + else + echo "$x" + fi + done +} + +list "$1" |