I am trying to create a shellscript which could read files contained in a directory(given as a first argument $1) and then output the result(file path,file name and file type) into a text file which would be formated with header path, name and type. So at the end I have a file with 2 header(path/name, type) and the 2 columns containing the information. I tried this but it doesn't work:
Code:
#!/bin/bash
touch list_file
echo"Path - Name Type " > list_file
echo"---------------------------------------------------------------------------" >> list_file
file $1/* | tee test
test | tee -a list_file
Any help is welcome!
Cheers