GNHLUG
>
GNHLUG Web
>
TipsAndTricks
>
TatBash
(2011-07-22,
LloydKvam
)
(raw view)
E
dit
A
ttach
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. <pre> 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 </pre> 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. -- %MAINWEB%.LloydKvam - 11 Dec 2010
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2011-07-22
-
LloydKvam
GNHLUG
Log In
or
Register
GNHLUG Web
Create New Topic
Index (Page List)
Search this Web
Recent Changes
RSS Feed
Site Tools
Search site
Site changes
Webs
GNHLUG
Main
Org
TWiki
Contact GNHLUG
All content is Copyright © 1999-2025 by, and the property of, the contributing authors.
Questions, comments, or concerns?
Contact GNHLUG
.
All use of this site subject to our
Legal Notice
(includes Terms of Service).