Table format with ShellScript
From within the shellscript I'd like first to create a file with a table containing two headers( path-name, type) and then feed those columns with the result from the following code:
Code:
file $1/*|tee list_file The final result should look something like that but with more space between the headers and columns : ----------------------------------------------- path-name type ----------------------------------------------- /home/file ASCII /home/file2 Texte file /home/file3.htm HTML document text ----------------------------------------------- I tried the following code but that doesn't do the trick: Code:
file $1/*|tee list_file | awk 'BEGIN {print "Path-Name\t\t\tType\n--------------------------------------------"} {print $1"\t"$2} \ |
Look into awk's ability to handle fixed-width fields.
Yves. |
Hello Yves,
The truth is that I 've been unable to get the table with the ouput content. I tried that but it still don't work: Code:
|
All times are GMT -5. The time now is 11:03 AM. |