Odoo18-Base/setup/dir2file.sh
2025-03-10 11:18:05 +07:00

10 lines
352 B
Bash
Executable File

#!/bin/bash
# Define output file name
input_dir="$1"
output_file="$2"
# Find all directories in root and write to file
# Using find to list only directories (-type d) at depth 1 (-maxdepth 1)
find $input_dir -maxdepth 1 -type d -not -path "$input_dir" -exec basename {} \; | sort >> "$output_file"
echo "Folder list has been written to $output_file"