I have a folder full of files with a .dot extension like this:
a.dot
b.dot
c.dot
I want to go through all the files in this folder and run a command on them such as this:
dot -Tpdf a.dot -o a.pdf
dot -Tpdf b.dot -o b.pdf
dot -Tpdf c.dot -o c.pdf
I am guessing that I need to use the vertical bar and do a command like this:
ls *.dot | dot -Tpdf ... -o ....pdf
But I don't know how to make the pipe place each file onto the middle part only. Should I be using xargs? Furthermore, how to strip the extension then also place it onto the second part. If I could be at least pointed in the right direction (which shell command to use) it would help me very far along the way to figuring this out.
*.dotintoa.dot b.dot c.dot);lsis a tool intended for humans, when you want to display file attributes (size, date, etc.). – Gilles Feb 27 '12 at 2:09