Odoo18-Base/setup/dir2file.sh

10 lines
352 B
Bash
Raw Permalink Normal View History

2025-03-05 09:36:25 +07:00
#!/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"