<<O>>  Difference Topic TatBash (r1.2 - 22 Jul 2011 - LloydKvam)
Changed:
<
<
META TOPICPARENT TipsAndTricks?
>
>
META TOPICPARENT TipsAndTricks?

How do you paste some file names into your terminal console and process them when they are separated by new-lines?

I thought the solution would be to group them somehow using () or {} or [], but none of those worked for me. Finally I tried using quotes and that did the trick.

 <<O>>  Difference Topic TatBash (r1.1 - 11 Dec 2010 - LloydKvam)
Line: 1 to 1
Added:
>
>
META TOPICPARENT TipsAndTricks?
How do you paste some file names into your terminal console and process them when they are separated by new-lines?

I thought the solution would be to group them somehow using () or {} or [], but none of those worked for me. Finally I tried using quotes and that did the trick.

for f in '/usr/share/doc/python-soaplib/examples/async.py
/usr/share/doc/python-soaplib/examples/binary.py
/usr/share/doc/python-soaplib/examples/override.py' ; do cp $f .; done

This processes one file at a time using a for-loop. The loop variable is f. Semi-colons separate the commands. do and done mark the loop boundaries.

The key-strokes to accomplish this, after the file names had been copied into the buffer were:

for f in '{shift-control-v}' ; do cp $f .; done

where {shift-control-v} means to press Shift and Ctrl and V together, much as you'd do for a capital V, but also holding down the Ctrl key.

-- LloydKvam - 11 Dec 2010

Revision r1.1 - 11 Dec 2010 - 09:57 - LloydKvam
Revision r1.2 - 22 Jul 2011 - 09:17 - LloydKvam