Shell-Skript: Lesen Sie die Zeile in der Datei

Ich habe eine Datei paths.txt:

/my/path/Origin/.:your/path/Destiny/.
/my/path/Origin2/.:your/path/Destiny2/.
/...
/...

Ich brauche ein Skript CopyPaste.sh mit Datei paths.txt kopieren Sie alle Dateien in OriginX zu DestinyX

Sowas:

 #!/bin/sh

while read line
do
        var= $line | cut --d=":" -f1
        car= $line | cut --d=":" -f2
        cp -r var car

done < "paths.txt"
Die syntax ist var=$(command), während Sie tun var = command, die interpretiert wird als "ausführen var Befehl mit = und command Parameter".

InformationsquelleAutor user3228279 | 2014-01-31

Schreibe einen Kommentar