NewsedQuestion
First-off,I'vealreadysolvedtheproblemIhad(strippingwhitespaceoutofalargefile)butI'mcuriousaboutsed'sbehaviour.
Ingredients:
WindowsXPPro
GNUsedversion3.02
A21MBtextfilewithwhitespace.
Method:
Asimplesed"s///g"InpFile.txt>OutFile.txt
Result:
Myassumptionwasitwouldgothroughthefilelinebyline,stripoutthewhitespace,
>andwriteittooutput.However,memoryusagesteadilyincreasedto1GB,whereuponXPsaid'
>Nomorememoryforyou!'andtheprocessdiedwith'Can'twritetononexistantpipe'.
VariationsliketypeInpFile.txt|sed"s///g">OutFile.txtdidthesamething.
I'mtoomuchofawusstotrythisonourUnixbox,lestitdoesthesamething,
>causingtheadminstostormoutofasmokingserverroomwieldingasharpenedcluex4.
Question:
Isthisnormal/expectedbehaviourforsed?
Sidenote:
IntheendIusedtr,likeIshouldhavedoneallalong.Tookjustafewseconds.
[edit note: manually break the long lines to make display more palatable]