I am still very new to Linux, and I am tasked with writing a bash script that outputs various details inside a menu box. These details include:
Directory owner/permissions,
Number of files in directory,
and Name and size of biggest file
Here is what I have so far:
function show_details(){
read -p "Please enter a path: " path1
cd $path1
ls -ld | > $OUTPUT
ls | wc -l > $OUTPUT
find . -maxdepth 1 -printf '%s %p\n'|sort -nr|head -n 1 > $OUTPUT
display_output 13 25 "Details"
}
It successfully reads the path, as well as outputs name and size of biggest file, but skips the first two. What am I doing wrong that causes the output file to ONLY read the final '> $OUTPUT' with name/biggest file? Any help is appreciated!