At 06:21 PM 3/13/00 +0100, Rodrigo Moya wrote:
>Hi all!
>
>I've got a text file containing the following:
>
>/dir/file1=/mnt/zip/dir/file1
>/dir/dir/file2=/mnt/zip/dir/dir/file1
>...
>
>and like this with hundreds of files. What I want is to read all the
>file and copy the files in the first position (to the left of '=') to
>the place specified by the string at the right of '='. But I don't know
>how to split the line from a shell script (as you guessed I'm quite bad
>at shell programming).

Pipe it through

sed -e 's/^/cp /' -e 's/=/ /'

and the output will be shell commands of the form

cp /dir/file1 /mnt/zip/dir/file1
cp /dir/dir/file2 /mnt/zip/dir/dir/file1

------
David Lupo <[EMAIL PROTECTED]>


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to