I have a list of data that I need to analyze. The first thing I do is check whether the file is indeed the one I want, then I sort the data according to the 4th column, and then I need to manually order the sorted line.
For example, I need to print the 3rd word in the line, and then the first word etc.
Here is what I wrote:
mainScript :
#!/bin/bash
for file in `ls ${1}` ; do
if [[ ! ($file = *.user) ]] ; then
continue
fi
sort -nrk4 $file | source printer_script
done
printer_script :
#!/bin/bash
echo $3
echo $1
echo $2
Why nothing gets printed even though I send the sorted lines by pipeline?