OFF TOPIC (was: Re: moving directory from one hd to another)

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Nov 4 12:50:45 EET 1999


N P <sten38 at yahoo.com> writes:

> >> >"cd olddir ; tar cvf - . | (cd newdir; tar xvfp
> -)"
> >
> >> DJ art auta edo ta perierga uparxoun sth selida
> sou? Oxi tipota allo,
> >> alla pera apo to | den ksero tipota apo ta alla
> sumbola. (ksero tis
> >> entoles ennoeitai) N.P.
> >
> >Einai giati ayta ta symbola einai grammena stin
> Chinese Traditional, ki oxi
> >stin Chinese Simplified ekdosi tou bash :P

> 8a to ektumousa an anti na koroideueis kapoion pou den ta exei
> ksanapetuxei pote pou8ena, eite den edines shmasia eite tou ta
> ekseigouses.

Okie, here it goes... eipa na min sas prikso me tis makrosyrtes
eksigiseis mou aaalli mia fora, te8pa.

    cd olddir ; tar cvf - . | ( cd newdir ; tar xvfp )

Loipon... ta erwtnmatika einai diaxoristes entolwn pou 8a ektelestoun h
mia meta tin alli.  Opote to "cd olddir" 8a ektelestei prwta, allazontas 
to trexon directory se "olddir".

To pipe (auto to | pragma) ksexorisei ta duo (h perissotera) meri mias
entolis pou to kathe stadio stelnei mesw tou standard output tou tin
eisodo sto epomeno stadio.  Opote, otidnpote grapsei to "tar cvf - ."
stin standard eksodo tou, 8a to parei to "(cd new ...)" san standard
eisodo.  Auta ta duo stadia, sto Unix, trexoun *tautoxrona* san duo
ksexoristes diergasies [se antithesi me to DOS pou trexei prwta to prwto 
stadio, grafontas to output se ena arxeio me tuxaio onoma, kai meta
trexei to deutero stadio me to `tuxaio' arxeio san eisodo, pipes leei
meta, bliaaax].

As doume twra ti kanoun ta duo meri tou pipe line.  To "tar cvf - ." apo
to manual tou tar mporei kaneis eukola na brei pos `sumpiezei' (kai ta
eisagogika 8a poume giati einai ekei) me arxeio eksodou to "-", dhladh
tin standard eksodo [wste to sumpiesmeno pragma na perasei mesa apo to
pipe pou legame prin apo ligo], kai san eisodo [auto pou 8a sumpiesei
dhladh, pairnei to trexon directory].  Opote, ftiaxnei ena .tar arxeio
kai to pernaei on-the-fly mesa apo to pipe, pou to epomeno stadio tou
pipe prepei na kserei ti na to kanei.

H parametros 'v' anamesa sto 'cvf' sou tar, einai gia na tuponei kai ta
onomata twv arxeiwv pou swzei mesa sto arxeio eksodou (tin standard
eksodo edw), wste na blepeis ektelontas tin entoli pos proxoraei sto
xrono.  Kali fasi, otan ta arxeia pou sumpiezontai einai mikra, giati an 
einai megala, apla tha soy typonei ena filename kathe misi wra, opote
den exei kai polu aksia ws metro tis taxititas tou tar, apla dinei mia
mikri endeiksi tou an to programma exei kollisei, ki oxi
panta... eksallou, gi' auto einai kali akoma ki h apli ps(1).

Twra giati ta eisagogika sto `sumpiezei'.  Giati ws gvwstov to tar,
gemizei akeraio arithmo apo blocks stin eksodo tou, afou arxika eixe
ftiaxtei gia na grafei se tapes, pou exoun stathero block size.   Opote, 
an ena arxeio den exei megethos akribos pollaplasio tou block size pou
xrhsimopoiei to tar, to gemizei me mhdenika mexri na ftasei to epomeno
pollaplasio tou block size [zero padding].

Etsi to prwto stadio tou pipe ftiaxnei ena .tar apo to trexon directory
kai to petaei sto deutero stadio.

To deutero stadio einai mesa se parentheseis.  Auto snmaivei pws sto
/bin/sh, tha ektelestei mesa sto diko tou 'periballon', sinithos ena
child-process, opote allazontas to periballon mesa stis parentheseis den
tha epireasei ta upoloipa stadia tou pipe, prongoumeva H epomena.

Etsi h prwti entoli tou (...) einai mia entoli pou allazei to trexon
directory sto "newdir", xwris auto na epireazei oute to prwto stadio tou 
pipe, pou sunexizei na ekteleitai mesa sto "olddir" opws kai prwta, kai
pio snmantiko xwris na ephreazei to trexon directory tou shell pou
ektelei OLH tin entoli.

Mesa sto (...) twra, afou ektelestei h "cd newdir", ena deutero "tar"
pairnei apo tin standard eisodo to on-the-fly-tar pou eftiakse i proti
"tar", kai to aposumpiezei (option "x").  Ki edw exei to option "v",
opote tha typonei ki auto ta onomata twv arxeiwv pou dhmiourgei.  To
option "f" einai opws ki edw gia na tou poume oti amesos meta akolouthei
to arxeio eisodou (auti ti fora to tar diabazei *apo* to arxeio pou tou
dinoume ki aposumpiezei).  POLY snmantiko epishs einai to option "p",
pou leei sto tar na prospathisei na diathrhsei ta permissions pou eixe
arxika to arxeio.

Isws 8a itan pio kala, na uphrxe kai to option "s" pou 8a diathrouse kai 
ton owner twv arxeiwv, alla auto thelei na ekteleis OLH tin entoli san
root, giati sinithos mono autos mporei na kanei `chown' (an kai se
merika setup, OUTE autos mporei).

Aaauta.

> PS : Polu eksupno. Mporeis na mou peis an
> perilambanetai kai sto EBCDIC ?

Den ksero, pws kanw aithsh na mpei?  Kai, kuriotero, TI einai auto to
EBCDIC, pou mexri kai se .sig tou ricudi kukloforouse kata kairous? :P

%!PS

Zntw suggvwmn av kourasa osous ksesouv auta pou eipa, kai bariountai na
ta akoune gia 32474357 fora.

-- 
Giorgos Keramidas, <keramida at ceid.upatras.gr>
"What we have to learn to do, we learn by doing." [Aristotle]
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list