ckermit80.txt 454 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280
  1. [1]The Columbia Crown The Kermit Project | Columbia University
  2. 612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
  3. ...since 1981
  4. [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
  5. [10]Support
  6. C-Kermit 8.0 Update Notes
  7. Second Supplement to Using C-Kermit, 2nd Edition
  8. For C-Kermit 8.0
  9. As of C-Kermit version: 8.0.211
  10. Date of C-Kermit release: 10 April 2003
  11. This file last updated: Mon Sep 13 08:52:36 2010
  12. * IF YOU ARE READING A PLAIN-TEXT version of this document, note that
  13. it is a plain-text dump of a Web page. You can visit the original
  14. (and possibly more up-to-date) Web page here:
  15. [15]http://www.columbia.edu/kermit/ckermit80.html
  16. * If you are reading the HTML version of this file with a GUI Web
  17. browser, the features added since C-Kermit 8.0.201 are shown in red
  18. if your browser and monitor permit. Features that were new to
  19. versions 8.0.200 and 201 are in black.
  20. Authors: Frank da Cruz and Christine M. Gianone
  21. Address: The Kermit Project
  22. Columbia University
  23. 612 West 115th Street
  24. New York NY 10025-7799
  25. USA
  26. Fax: +1 (212) 662-6442
  27. E-Mail: [16]kermit-support@columbia.edu
  28. Web: [17]http://www.columbia.edu/kermit/
  29. Or: [18]http://www.kermit-project.org/
  30. Or: [19]http://www.columbia.nyc.ny.us/kermit/
  31. NOTICES
  32. This document:
  33. Copyright © 1997, 2002, Frank da Cruz and Christine M. Gianone.
  34. All rights reserved.
  35. Kermit 95:
  36. Copyright © 1995, 2002, Trustees of Columbia University in the
  37. City of New York. All rights reserved.
  38. C-Kermit:
  39. Copyright © 1985, 2002,
  40. Trustees of Columbia University in the City of New York. All
  41. rights reserved. See the C-Kermit [20]COPYING.TXT file or the
  42. copyright text in the [21]ckcmai.c module for disclaimer and
  43. permissions.
  44. When Kerberos(TM) and/or SRP(TM) (Secure Remote Password) and/or
  45. SSL/TLS protocol are included:
  46. Portions Copyright © 1990, Massachusetts Institute of
  47. Technology.
  48. Portions Copyright © 1991, 1993 Regents of the University of
  49. California.
  50. Portions Copyright © 1991, 1992, 1993, 1994, 1995 by AT&T.
  51. Portions Copyright © 1997, Stanford University.
  52. Portions Copyright © 1995-1997, Eric Young <eay@cryptosoft.com>.
  53. For the full text of the third-party copyright notices, see
  54. [22]Appendix V.
  55. WHAT IS IN THIS FILE
  56. This file lists changes made to C-Kermit since version 7.0 was released
  57. in January 2000. Use this file as a supplement to:
  58. * The second edition of [23]Using C-Kermit; and:
  59. * The [24]C-Kermit 7.0 Update Notes. Also available in plain-text
  60. form as [25]ckermit70.txt.
  61. until the third edition of Using C-Kermit is published. We apologize
  62. for the scattered documentation and will consolidate it when we are
  63. able.
  64. ADDITIONAL FILES
  65. Several other files accompany this new Kermit release:
  66. [26]ckututor.html
  67. C-Kermit Tutorial (for Unix). Also distributed in Nroff form as
  68. [27]ckuker.nr, the Unix C-Kermit manual page.
  69. [28]security.htm
  70. Discussion of Kermit's new authentication and encryption
  71. features, updated for C-Kermit 8.0.
  72. [29]telnet.htm
  73. Detailed documentation of Kermit's Telnet client, updated for
  74. C-Kermit 8.0.
  75. [30]ftpscripts.html
  76. Tutorial: Writing FTP automation scripts
  77. [31]ckcbwr.html
  78. Platform-independent C-Kermit hints and tips. Also distributed
  79. in plain text form as [32]ckcbwr.txt
  80. [33]ckubwr.html
  81. Unix-specific C-Kermit hints and tips. Also distributed in plain
  82. text form as [34]ckubwr.txt.
  83. [35]ckvbwr.html
  84. VMS-specific C-Kermit hints and tips. Also distributed in plain
  85. text form as [36]ckvbwr.txt.
  86. [37]ckuins.html
  87. Unix C-Kermit installation instructions. Also distributed in
  88. plain text form as [38]ckuins.txt.
  89. [39]ckvins.html
  90. VMS C-Kermit installation instructions. Also distributed in
  91. plain text form as [40]ckvins.txt.
  92. [41]ckccfg.html
  93. Compile-time configuration options. Also distributed in plain
  94. text form as [42]ckccfg.txt.
  95. [43]ckcplm.html
  96. C-Kermit Program Logic Manual. Also distributed in plain text
  97. form as [44]ckcplm.txt.
  98. [45]iksd.html
  99. Internet Kermit Service Administrators Guide for Unix.
  100. [46]skermit.html
  101. C-Kermit as an SSH Subsystem (SFTP server replacement).
  102. [ [47]Top ] [ [48]C-Kermit ] [ [49]Kermit Home ]
  103. CONTENTS
  104. [50]0. WHAT'S NEW
  105. [51]1. FIXES SINCE VERSION 7.0.196
  106. [52]2. SSH AND HTTP
  107. [53]2.1. SSH Connections
  108. [54]2.2. HTTP Connections
  109. [55]2.2.1. HTTP Command Switches
  110. [56]2.2.2. HTTP Action Commands
  111. [57]2.2.3. HTTP Headers
  112. [58]2.2.4. Secure HTTP Connections
  113. [59]2.2.5. HTTP Variables
  114. [60]2.2.6. The HTTP Command-Line Personality
  115. [61]3. THE BUILT-IN FTP CLIENT
  116. [62]3.1. Making and Managing FTP Connections
  117. [63]3.1.1. Kermit Command-Line Options for FTP
  118. [64]3.1.2. The FTP Command-Line Personality
  119. [65]3.1.3. The FTP URL Interpreter
  120. [66]3.1.4. Interactive FTP Session Establishment
  121. [67]3.2. Making Secure FTP Connections
  122. [68]3.3. Setting FTP Preferences
  123. [69]3.4. Managing Directories and Files
  124. [70]3.5. Uploading Files With FTP
  125. [71]3.5.1. FTP PUT Switches
  126. [72]3.5.2. Update Mode
  127. [73]3.5.3. Recovery
  128. [74]3.6. Downloading Files With FTP
  129. [75]3.6.1. FTP GET Switches
  130. [76]3.6.2. Filename Collisions
  131. [77]3.6.3. Recovery
  132. [78]3.7. Translating Character Sets
  133. [79]3.7.1. Character Sets and Uploading
  134. [80]3.7.2. Character Sets and Downloading
  135. [81]3.8. FTP Command Shortcuts
  136. [82]3.9. Dual Sessions
  137. [83]3.10. Automating FTP Sessions
  138. [84]3.10.1. FTP-Specific Variables and Functions
  139. [85]3.10.2. Examples
  140. [86]3.10.3. Automating Secure FTP Connections
  141. [87]3.11. Advanced FTP Protocol Features [88]4. FILE SCANNING
  142. [89]5. FILE AND DIRECTORY NAMES CONTAINING SPACES
  143. [90]6. OTHER COMMAND PARSING IMPROVEMENTS
  144. [91]6.1. Grouping Macro Arguments
  145. [92]6.2. Directory and File Name Completion
  146. [93]6.3. Passing Arguments to Command Files
  147. [94]6.4. More-Prompting
  148. [95]6.5. Commas in Macro Definitions
  149. [96]6.6. Arrow Keys
  150. [97]7. NEW COMMANDS AND SWITCHES
  151. [98]8. SCRIPTING IMPROVEMENTS
  152. [99]8.1. Performance and Debugging
  153. [100]8.2. Using Macros as Numeric Variables
  154. [101]8.3. New IF Conditions
  155. [102]8.4. The ON_UNKNOWN_COMMAND and ON_CD Macros
  156. [103]8.5. The SHOW MACRO Command
  157. [104]8.6. Arrays
  158. [105]8.7. New or Improved Built-in Variables and Functions
  159. [106]8.8. The RETURN and END Commands
  160. [107]8.9. UNDEFINing Groups of Variables
  161. [108]8.10. The INPUT and MINPUT Commands
  162. [109]8.11. Learned Scripts
  163. [110]8.12. Pattern Matching
  164. [111]8.13. Dates and Times
  165. [112]8.14. Trapping Keyboard Interruption
  166. [113]9. S-EXPRESSIONS
  167. [114]9.1. What is an S-Expression?
  168. [115]9.2. Integer and Floating-Point-Arithmetic
  169. [116]9.3. How to Use S-Expressions
  170. [117]9.4. Summary of Built-in Constants and Operators
  171. [118]9.5. Variables
  172. [119]9.6. Assignments and Scope
  173. [120]9.7. Conditional Expressions
  174. [121]9.8. Extensibility
  175. [122]9.9. Examples
  176. [123]9.10. Differences from Algebraic Notation
  177. [124]9.11.Differences from Lisp
  178. [125]10. FILE TRANSFER
  179. [126]11. MODEMS AND DIALING
  180. [127]12. TERMINAL CONNECTION
  181. [128]13. CHARACTER SETS
  182. [129]14. DIALOUT FROM TELNET TERMINAL SERVERS
  183. [130]15. COPING WITH BROKEN KERMIT PARTNERS
  184. [131]16. NEW COMMAND-LINE OPTIONS
  185. [132]17. LOGS
  186. [ [133]Top ] [ [134]C-Kermit ] [ [135]Kermit Home ]
  187. 0. WHAT'S NEW
  188. The Initialization and Customization Files
  189. C-Kermit 8.0 now supports specification of the initialization
  190. file name (path) in an environment variable, CKERMIT_INI. It
  191. also relies far less than before on the initialization for
  192. functioning. See [136]Section 5 of the Unix C-Kermit
  193. [137]installation instructions for details. As of version
  194. 8.0.201, C-Kermit also executes your customization file (if you
  195. have one) even if the initialization file was not found.
  196. Previously, the customization file was executed by a TAKE
  197. command in the initialization file (and it still is, if an
  198. initialization is found).
  199. Incompatible Changes
  200. As always, we do our best to avoid changes that break existing
  201. scripts. However, C-Kermit 8.0 does include a rather pervasive
  202. syntax change that might alter the behavior of scripts that
  203. depend on the previous behavior. As described in [138]Section 5,
  204. C-Kermit now accepts doublequotes in most contexts where you
  205. previously had to use braces to group multiple words into a
  206. single field, or to force inclusion of leading or trailing
  207. blanks. Most noticeably, in C-Kermit 7.0 and earlier:
  208. echo {this is a string}
  209. would print:
  210. this is a string
  211. whereas:
  212. echo "this is a string"
  213. printed:
  214. "this is a string"
  215. In C-Kermit 8.0, both print:
  216. this is a string
  217. To force the doublequotes to be treated as part of the string,
  218. use either of the following forms:
  219. echo {"this is a string"}
  220. echo ""this is a string""
  221. Similarly, to force braces to be treated as part of the string:
  222. echo "{this is a string}"
  223. echo {{this is a string}}
  224. Other incompatibilities:
  225. 1. Using the SET HOST command to make HTTP connections is no
  226. longer supported. Instead, use the new HTTP OPEN command,
  227. described in [139]Section 2.2.
  228. C-Kermit 7.1 Alpha.01 (8 December 2000)
  229. Its major new features are those listed in the [140]Table of
  230. Contents: the FTP client, file scanning, command parsing and
  231. scripting improvements, S-Expressions, and support for the
  232. Telnet Com Port Option, plus wider availability of the Kerberos,
  233. SSL/TLS, and SRP security options for secure Internet
  234. connections.
  235. C-Kermit 7.1.199 Alpha.02 (4 January 2001)
  236. + C-Kermit now accepts [141]FTP, TELNET, and IKSD URLs as its
  237. first command-line argument.
  238. + Character-set translation added to the FTP client for
  239. [142]filenames.
  240. + Optional [143]setting of date of incoming files by FTP [M]GET
  241. from the server date.
  242. + [144]FTP CHECK filename added to let FTP client check the
  243. existence of a file on the server.
  244. + [145]FTP GET /NAMELIST:filename added to get list of server
  245. filenames into a local file.
  246. + [146]FTP [M]PUT /SERVER-RENAME:template added to make server
  247. rename a file as indicated by the template after it has
  248. arrived completely.
  249. + FTP [M]GET /SERVER-RENAME:template added to make server rename
  250. a file as indicated by the template after it has been sent
  251. completely.
  252. + FTP [147]VDIRECTORY added for getting verbose directory
  253. listings from TOPS-20.
  254. + [148]FTP TYPE TENEX added for transferring 8-bit binary files
  255. with PDP-10s.
  256. + Added [149]automatic text/binary mode switching for FTP
  257. [M]GET, based on filename patterns (e.g. *.zip, *.gz, *.exe
  258. are binary; *.txt, *.c are text).
  259. + [150]SET SEND I-PACKETS OFF added for coping with Kermit
  260. servers that do not support I packets.
  261. + A new option was added to [151]\fword() and \fsplit() for
  262. parsing comma-separated lists that might contain empty
  263. elements.
  264. + Bug fixes including:
  265. o {} or "" could not be used as expected to represent the
  266. empty string.
  267. o ,- on a line by itself in a macro definition caused
  268. subsequent statements to be skipped.
  269. o FTP [M]GET didn't work right if path segments were
  270. included in the filespec.
  271. o FTP MGET, if interrupted, did not clear its file list.
  272. o Various problems with FTP PUT /AS-NAME that nobody
  273. noticed.
  274. o Some FTP messages and displays interfered with each
  275. other.
  276. o Parsing of YESTERDAY, TODAY, and TOMORROW in date-time
  277. fields was broken.
  278. o Automatic old-to-new dialing directory format conversion
  279. was broken on VMS.
  280. o Various source-code portability problems fixed.
  281. + Improvement of various HELP and SHOW messages.
  282. C-Kermit 7.1.199 Alpha.04 (1 April 2001)
  283. + Big changes:
  284. o Changed default modem type from NONE to GENERIC.
  285. o Generic dialing now sends no init string at all.
  286. o Changed default terminal bytesize from 7 to 8.
  287. + New features:
  288. o SET SESSION-LOG TIMESTAMPED-TEXT for timestamped session
  289. log.
  290. + New modem types:
  291. o Conexant modem family
  292. o Lucent VENUS chipset
  293. o PCTel V.90 chipset
  294. o Zoom V.90
  295. o Zoom V.92
  296. + FTP client:
  297. o FTP OPEN /PASSIVE and /ACTIVE switches added.
  298. o Now works with servers that that don't include path in
  299. NLST response.
  300. o Fixed SEND /RECURSIVE not to follow symlinks (UNIX).
  301. o SET FTP VERBOSE-MODE default is now OFF instead of ON.
  302. + Kermit protocol:
  303. o Fixed what I hope is the last "Receive window full"
  304. error.
  305. o SET PREFIXING or SET CONTROL PREFIX now automatically
  306. sets CLEARCHANNEL OFF.
  307. o Fixed incorrect report of number of files transferred at
  308. end of transfer.
  309. o Fixed SEND /RECURSIVE not to follow symlinks (UNIX).
  310. + UNIX:
  311. o HTTP and shadow passwords enabled for SCO 5.0.6.
  312. o Even with SET FILENAMES CONVERTED, spaces were still
  313. accepted in incoming filenames; now they are converted to
  314. underscores.
  315. o Added support for compile-time mktemp()/mkstemp()
  316. selection.
  317. + VMS:
  318. o Session-log format for scripted sessions fixed.
  319. + Scripting:
  320. o Fixed \frdir() not to follow symlinks (UNIX).
  321. o Fixed \fday() not to dump core for dates prior to 17 Mar
  322. 1858.
  323. + General:
  324. o "Closing blah..." message upon exit could not be
  325. suppressed.
  326. o Added /PAGE and /NOPAGE to DELETE switches.
  327. o Added GO response for DELETE /ASK (delete all the rest
  328. without asking).
  329. o Added GO response to "more?" prompt (for multi-page
  330. screen output).
  331. o Updated HELP texts.
  332. C-Kermit 7.1.199 Beta.01 (10 May 2001)
  333. + FTP client verbosity adjustments.
  334. + Bug with generic modem dialing pausing several secs fixed.
  335. + SET HOST /USER:, SET LOGIN USERID, etc, fixed when given no
  336. user ID.
  337. + A couple \v(dm_blah) dial modifier variables added.
  338. + "--version" command-line switch added.
  339. + Fixed NetBSD serial-port DTR handling.
  340. + Lots of syntax cleanups for Flexelint and gcc -Wall.
  341. + Fixed modem-type aliases to not take precedence over real
  342. names.
  343. + Fixed funny treatment of doublequotes by ECHO command.
  344. + Enabled SET SESSION-LOG for VMS and other non-UNIX platforms.
  345. + Fixed changing direction in command history buffer.
  346. + Fixed handling of IKSD URLs.
  347. + Made sure DELETE prints a message if it got any errors.
  348. C-Kermit 8.0.200 Beta.02 (28 June 2001)
  349. + Major version number increased from 7 to 8.
  350. + [152]SSH command.
  351. + More-consistent Kermit protocol defaults.
  352. + CONNECT idle timeout and action selection.
  353. + CONNECT status variable.
  354. + A way to allocate more space for filename lists.
  355. + Pseudoterminal handler fixed for late-model Linuxes.
  356. + Command-line option -dd for timestamped debug log.
  357. + Download directory now works for external protocols too.
  358. + GREP /COUNT:variable.
  359. + SET ATTRIBUTE RECORD-FORMAT { OFF, ON }.
  360. + Bug fixes.
  361. C-Kermit 8.0.200 Beta.03 (9 Sep 2001)
  362. + [153]HTTP 1.1 connections and scripting
  363. + [154]ON_CTRLC macro for trapping Ctrl-C in scripts
  364. + [155]Date-time parsing improvements, timezones, comparison,
  365. arithmetic
  366. + [156]Pattern-matching improvements
  367. + FTP improvements
  368. + SET EXIT HANGUP { ON, OFF }
  369. + SET FILE EOF { CTRL-Z, LENGTH }
  370. + ASK[Q] /TIMEOUT
  371. + Bug fixes
  372. + New platforms
  373. C-Kermit 8.0.200 Beta.04 (16 Nov 2001)
  374. + [157]New Unix man page
  375. + [158]New Unix installation instructions
  376. + SET TELOPT policies are now enforced on non-Telnet ports if
  377. the server begins Telnet negotiations.
  378. + SET TERMINAL IDLE-ACTION { TELNET-NOP, TELNET-AYT }.
  379. + UUCP lockfile creation race condition fixed.
  380. + Dialout, modem signals, hangup, hardware flow control, etc,
  381. tested extensively on many platforms, numerous problems fixed.
  382. + Improved hints when dialing fails.
  383. + SET STOP-BITS 2 can now be given without SET FLOW HARDWARE.
  384. + Major improvements in RFC 2217 Telnet Com-Port Control.
  385. + Improved ability to REDIAL a modem server port.
  386. + kermit -h now shows the command name in the usage usage
  387. string.
  388. + kermit -h now shows ALL command-line options.
  389. + kermit -s blah, where blah is a symlink, now works.
  390. + --noperms command-line option = SET ATTRIBUTE PERMISSIONS OFF.
  391. + HTTP and HTTPS URLs now supported on the command line.
  392. + An http command-line personality is now available.
  393. + Initialization file streamlined to load faster, anachronisms
  394. removed.
  395. + Updated NEWS, INTRO, HELP text, SHOW commands. In particular,
  396. see SHOW COMM, HELP SET LINE, HELP WAIT.
  397. + Date/time arithmetic routines converted from floating-point to
  398. integer arithmetic (internally) for greater accuracy and
  399. portability.
  400. + Quoted strings containing commas no longer break macro
  401. execution.
  402. + Dynamic Kermit file-transfer timeouts are now much more
  403. aggressive.
  404. + New "hot keys" to turn debug.log on/off during file transfer.
  405. + Improved hints when file transfer fails.
  406. + FTP CD orientation messages are now printed.
  407. + -R now accepted on the FTP command line to request Recursion.
  408. + -m allows Active or Passive mode to be chosen on the FTP
  409. command line.
  410. + -dd on the FTP command line creates a timestamped debug.log.
  411. + FTP command-line security options filled in.
  412. + Improved automatic text/binary mode switching for MGET.
  413. + Removed spurious error messages that sometimes occur during
  414. MGET.
  415. + DIRECTORY, GREP, TYPE, HEAD, and TAIL now have a /OUTPUT:file
  416. option.
  417. + TYPE /NUMBER adds line numbers.
  418. + CAT = TYPE /NOPAGE; MORE = TYPE /PAGE.
  419. + GETOK ?-help fixed.
  420. + \v(timestamp) (= "\v(ndate) \v(time)")
  421. + \v(hour) (hour of the day, 0-23)
  422. + \funix2dospath() converts a UNIX path (/) to a DOS one (\).
  423. + \fdos2unixpath() converts a DOS (Windows, OS/2) path to a UNIX
  424. one.
  425. + \fkeywordval() parses name=value pair, allows macro keyword
  426. parameters.
  427. + We now make every attempt to not write passwords to the
  428. debug.log.
  429. + New Certificate Authority certificates file, includes the
  430. Kermit Project at Columbia University so you can access our
  431. IKSD securely.
  432. + Secure targets improved and better documented in Unix
  433. makefile.
  434. + All Linux (libc and glibc) builds consolidated under "make
  435. linux".
  436. + HP-UX makefile targets now have consistent names.
  437. + New aix50 and aix51 targets added.
  438. C-Kermit 8.0.200 Final (12 Dec 2001)
  439. + Remote/local-mode confusion on some platforms introduced in
  440. Beta.04, fixed.
  441. + Many of the makefile targets adjusted, new ones added.
  442. + New "make install" target should please most people.
  443. + New command: SHOW IKSD.
  444. + FTP over TLS.
  445. + Last-minute touchups to text messages, HELP text, etc.
  446. + Enable modem-signal reading for SCO OSR5 and Unixware 7.
  447. + Special superfast TRANSMIT /BINARY /NOECHO /NOWAIT mode added.
  448. + Fixed PBX dialing in unmarked-area-code case.
  449. + Improved SHOW COMMUNICATIONS tells lockfile directory, typical
  450. dialout device name.
  451. + Some FTP OPEN command parsing problems fixed.
  452. + Some errors in date arithmetic fixed.
  453. + New command: SET TERMINAL AUTODOWNLOAD { ..., ERROR { STOP,
  454. CONTINUE } }
  455. + New command: HELP FIREWALL.
  456. + SET MODEM HANGUP-METHOD DTR added as synonym for RS232-SIGNAL
  457. + Support for secure URL protocols added: telnets:, ftps:,
  458. https:.
  459. C-Kermit 8.0.201 (8 Feb 2002)
  460. + Installability as an [159]SSH v2 Subsystem.
  461. + [160]SET LOCUS command.
  462. + [161]L-versions of CD, DIR, DELETE, MKDIR, etc, to force local
  463. execution.
  464. + [162]USER and ACCOUNT added as synonyms for FTP USER and FTP
  465. ACCOUNT.
  466. + [163]SHOW VARIABLES now accepts a list of variables.
  467. + Rudimentary support for [164]Caller ID when receiving phone
  468. calls.
  469. + Up/Down [165]Arrow-key navigation of command history buffer.
  470. + [166]Automatic execution of customization file if init file is
  471. missing.
  472. C-Kermit 8.0.206 Beta.01 (11 Oct 2002)
  473. New commands:
  474. o ORIENTATION lists location-related variables and their
  475. values.
  476. o KCD changes to special directories by their symbolic
  477. names ("kcd ?" for a list).
  478. o SET CD HOME path to specify home directory for CD and KCD
  479. commands.
  480. o CONTINUE given at top level is equivalent to END -- handy
  481. when PROMPT'ed out of a script, to continue the script.
  482. New switches or operands for existing commands:
  483. o GETOK /TIMEOUT
  484. o ASK, ASKQ, GETOK /QUIET (suppresses error message on
  485. timeout)
  486. o COPY /APPEND now allows concatenating multiple source
  487. files into one dest file.
  488. o SET TCP { HTTP-PROXY, SOCKS-SERVER } /USER, /PASSWORD.
  489. o DIRECTORY command now accepts multiple filespecs, e.g.
  490. "dir a b c".
  491. SET QUIET ON now also applies to:
  492. o SET HOST connection progress messages.
  493. o "Press the X or E key to cancel" file-transfer message.
  494. o REMOTE CD response.
  495. o REMOTE LOGIN response.
  496. Improvements and new features:
  497. o Numerous FTP client fixes and new features, listed below.
  498. o C-Kermit, when in remote mode at the end of a file
  499. transfer, now prints a one-line "where" message. Control
  500. with SET TRANSFER REPORT.
  501. o Unix makefile "install" target now creates an UNINSTALL
  502. script.
  503. o Improved operation and performance on RFC 2217 Telnet
  504. connections.
  505. o Improved CONNECT (interactive terminal connection)
  506. performance.
  507. o HELP text updated for many commands.
  508. New or fixed makefile targets:
  509. o Solaris 9 (several variations)
  510. o Concurrent PowerMAX
  511. o Mac OS X 10.2
  512. o FreeBSD 1.0
  513. o FreeBSD 4.6, 5.0
  514. o AIX 5.2, 5.3
  515. Bugs fixed (general):
  516. o Failure to run in VMS Batch fixed.
  517. o LDIRECTORY fixed to run Kermit's built-in DIRECTORY
  518. command rather than an external one.
  519. o Fixed Solaris and other SVORPOSIX builds to find out
  520. their full hostnames rather than just the "uname -n"
  521. name.
  522. o Fixed some problems matching strings that start with ".".
  523. o Fixed some problems matching pattern that contain {a,b,c}
  524. lists.
  525. o Fixed erroneous reporting of text-mode reception as
  526. binary when sender did not report the file size (cosmetic
  527. only).
  528. o Many problems with SWITCH statements fixed.
  529. o Fixed SET OPTIONS DIRECTORY /DOTFILES to work for server
  530. too.
  531. o Fixed DELETE to print an error message if the file was
  532. not found.
  533. o Fixed SET CONTROL UNPREFIX ALL and SET PREFIXING NONE to
  534. do the same thing.
  535. o Fixed bugs executing macros from within the ON_EXIT
  536. macro.
  537. o \fday() and \fnday() fixed for dates prior to 17 Nov
  538. 1858.
  539. o Serial speed-changing bug in Linux fixed.
  540. o "Unbalanced braces" script parsing errors when using
  541. \{number} fixed.
  542. o "if defined \v(name)" fixed to behave as described in the
  543. book.
  544. o Fixed Problems caused by LOCAL variables whose names are
  545. left substrings of macro names.
  546. o The INPUT command was fixed to honor the PARITY setting.
  547. o Fixed bug with COPY to existing file that is longer than
  548. source file.
  549. o REINPUT command failed to strip braces/quotes around its
  550. target string.
  551. o Network directory lookups didn't work for SSH
  552. connections.
  553. o REMOTE SET { FILE, TRANSFER } CHARACTER-SET fixed.
  554. o Closed some holes whereby an incompletely received file
  555. was not deleted when SET FILE INCOMPLETE is DISCARD, e.g.
  556. when the Kermit is hung up upon.
  557. o SET XFER CHARACTER-SET TRANSPARENT fixed to do the same
  558. as SET XFER TRANSLATION OFF.
  559. o SET HOST PTY (e.g. SSH) connection fixed to pass along
  560. window-size changes.
  561. o C-Kermit search path for TAKE files was accidentally
  562. disabled.
  563. FTP client bugs fixed:
  564. o Character set translation was broken on little-endian
  565. (e.g. PC) architectures.
  566. o FTP PUT /SERVER-RENAME:, /RENAME-TO:, /MOVE-TO: switches
  567. were sticky.
  568. o Make SET TRANSFER MODE MANUAL apply to FTP.
  569. o Make SET FILE INCOMPLETE { KEEP, DISCARD } apply to FTP.
  570. o FTP MGET /UPDATE handled equal times incorrectly.
  571. o FTP MGET /RECOVER fixed to ignore file dates, use only
  572. size.
  573. o FTP MGET /RECOVER sometimes downloaded files it didn't
  574. need to.
  575. o FTP downloads with TRANSFER DISPLAY BRIEF could give
  576. misleading error messages.
  577. o FTP MGET temp file not deleted if FTP DEBUG set to OFF
  578. after it was ON.
  579. o LOCUS not switched back when FTP connection is lost.
  580. o Set incoming file date even if it was not completely
  581. received.
  582. o FTP MGET sent SIZE and MDTM commands even when it didn't
  583. have to.
  584. o FTP MGET sent SIZE and MDTM commands even when it knew
  585. they wouldn't work.
  586. o FTP MGET failed if no files were selected for download.
  587. o FTP MGET a* b* c* would fail to get any c*'s if no b*'s
  588. existed.
  589. o Big problems canceling MGET with Ctrl-C.
  590. o Some extraneous LOCUS dialogs squelched.
  591. o Some inconsistencies in SET FTP FILENAMES AUTO fixed.
  592. o Fixed file-descriptor pileup after multiple MGETs when
  593. using mkstemp().
  594. o Fixed "mget foo", where foo is a directory name.
  595. FTP improvements:
  596. o New [167]FTP protocol features added (FEAT, MLSD).
  597. o FTP MGET /RECURSIVE now works as expected if server
  598. supports MLSD.
  599. o FTP MGET /DATES-DIFFER to download if local and remote
  600. file dates differ.
  601. o FTP DATES default changed to ON.
  602. o FTP MPUT, MGET /EXCEPT now allows up to 64 patterns (up
  603. from 8).
  604. o Top-level SITE and PASSIVE commands added for
  605. convenience.
  606. o MGET /COLLISION:APPEND /AS-NAME:newfile *.* puts all
  607. remote files into one local file.
  608. o SET FTP SERVER-TIME-OFFSET for when server has wrong
  609. timezone set.
  610. o Allow for alternative server interpretations of [M]MPUT
  611. /UNIQUE.
  612. o SET FTP ANONYMOUS-PASSWORD lets you specify the default
  613. anonymous password.
  614. o Allow "GET /RECURSIVE path/file" to force local
  615. subdirectory creation.
  616. o SET FTP DISPLAY is like SET TRANSFER DISPLAY but applies
  617. only to FTP.
  618. o FTP { ENABLE, DISABLE } new-protocol-feature-name.
  619. o FTP MGET /NODOTFILES.
  620. o Debug log now records FTP commands and responses in
  621. grep-able format.
  622. [ [168]Top ] [ [169]Contents ] [ [170]C-Kermit ] [ [171]Kermit Home ]
  623. 1. FIXES SINCE VERSION 7.0.196 First, the changes from 7.0.196 to 7.0.197...
  624. Source and makefile tweaks to get successful builds on platforms that were
  625. not available in time for the 7.0 release:
  626. * 4.2BSD
  627. * 4.3BSD
  628. * AIX 4.3
  629. * AT&T 3B2 and 3B20
  630. * BeOS 4.5
  631. * CLIX
  632. * Interactive UNIX System V/386 R3.2 V4.1.1
  633. * OS-9/68000
  634. * OSF/1 1.3.
  635. * PS/2 AIX 1.2.1
  636. * SCO OSR5.0.x
  637. * SCO Xenix 2.3.4
  638. * SINIX 5.41/Intel
  639. * Stratus FTX
  640. * Stratus VOS
  641. * SunOS 4.1 with X.25
  642. * Ultrix 4.2
  643. * Unixware 2.0
  644. There were no functional changes from 196 to 197.
  645. Fixes applied after C-Kermit 7.0.197 was released:
  646. Source code: Big flexelint and "gcc -Wall" audit and cleanup.
  647. Configuration:
  648. * Solaris RTS/CTS (hardware flow control) didn't work.
  649. * BSDI RTS/CTS worked only in one direction.
  650. * FreeBSD 4.0 with ncurses 5.0 broke interactive command parsing.
  651. * QNX-32 build lacked -DBIGBUFOK so couldn't execute big macros.
  652. Connections:
  653. * SET HOST /PTY didn't work on some platforms.
  654. * Broken SET HOST /USER:xxx /PASSWORD:yyy /ACCOUNT:zzz switches
  655. fixed.
  656. * Transparent printing was broken in Unix.
  657. * ANSWER 0 (wait forever) didn't work.
  658. * Some problems in Multitech modem command strings.
  659. * Spurious "?Sorry, can't condition console terminal" errors.
  660. * Disabling modem command strings by setting them to nothing broke
  661. dialing.
  662. * SET DIAL TIMEOUT value was usually ignored.
  663. * SET DIAL METHOD PULSE didn't work.
  664. * Certain modem commands, if changed, not refreshed if modem type
  665. changed.
  666. * SET SESSION-LOG command was missing from VMS.
  667. * VMS session log format fixed for scripts.
  668. * HANGUP by dropping DTR didn't work in NetBSD.
  669. * SET FLOW /AUTO versus SET FLOW confusion fixed.
  670. * Spurious secondary Solaris lockfile removed.
  671. * SCO OSR5 DTR On/Off hangup.
  672. * UUCP lockfile race condition.
  673. Commands and scripts:
  674. * Missing CAUTIOUS and FAST commands restored.
  675. * Broken PTY command in late-model Linuxes fixed (API changed).
  676. * Fixed off-by-one error in command recall when switching direction.
  677. * Fixed recall of commands that contain '?'.
  678. * COPY /SWAP-BYTES didn't work on some architectures.
  679. * Various combinations of COPY switches didn't work.
  680. * Various problems with COPY or RENAME with a directory name as
  681. target.
  682. * SHIFT didn't decrement \v(argc) if used within IF, ELSE, or SWITCH
  683. block.
  684. * SHIFT didn't affect the \%* variable.
  685. * Divide by zero improperly handled in some \function()s.
  686. * Problems with RETURN from right-recursive functions.
  687. * FSEEK /LINE \%c LAST didn't work if already at end.
  688. * Some buffer vulnerabilities and potential memory leaks were
  689. discovered and fixed.
  690. * \frdirectory() fixed not to follow symbolic links.
  691. * SET EXIT WARNING OFF fixed to work when EXIT given in a script.
  692. * Missing DELETE and MKDIR error message fixed.
  693. * \fday() core dump for ancient dates fixed.
  694. File transfer:
  695. * SEND /COMMAND was broken.
  696. * CRECEIVE was broken (but RECEIVE /COMMAND was OK).
  697. * Quoting wildcard chars in filenames didn't work.
  698. * Problems canceling streaming file transfers with X or Z.
  699. * Problems shifting between streaming and windowing file transfer.
  700. * Non-FULL file-transfer displays erroneously said STREAMING when
  701. not.
  702. * An active SEND-LIST prevented GET from working.
  703. * SET SERVER GET-PATH interpretation of relative names like "." was
  704. wrong.
  705. * The MAIL command was broken.
  706. * "kermit -s *" might have skipped some files.
  707. * Transaction log entries were not made for external protocol
  708. transfers.
  709. * File count report fixed to show number of files actually
  710. transferred.
  711. * Fixed filename conversion to convert spaces to underscores.
  712. * Made SET PREFIXING / SET CONTROL PREFIX also adjust CLEARCHANNEL.
  713. * More "Receive window full" errors fixed.
  714. * Broken terminal buffering after curses display in Solaris fixed.
  715. * SET FILE INCOMPLETE DISCARD did not work in all cases.
  716. * Packet log changed to reformat the start-of-packet character
  717. printably.
  718. * Dynamic timeouts could grow ridiculously large.
  719. Character sets:
  720. * Hebrew-7 translations missed the letter Tav.
  721. * C1 area of CP1252 was ignored.
  722. * SET TRANSFER CHARACTER-SET TRANSPARENT could give garbage
  723. translations.
  724. * TRANSLATE might not work on Little Endian architectures.
  725. * Insufficient range checking in certain TRANSLATE operations.
  726. The following bugs in C-Kermit 8.0.200 were fixed in 8.0.201:
  727. * An obscure path through the code could cause the Unix version of
  728. C-Kermit to dump core during its startup sequence. This happened to
  729. only one person, but now it's fixed.
  730. * When C-Kermit 8.0 is in Kermit server mode and the client says "get
  731. blah", where blah (on the server) is a symlink rather than a real
  732. file, the server unreasonably refused to send the linked-to file.
  733. * When C-Kermit is an FTP client and says "get foo/bar" (i.e. a
  734. filename that includes one or more path segments), it failed to
  735. accept the incoming file (this happened only with GET, not MGET).
  736. * Array references should be case insensitive but only lowercase
  737. array letters were accepted.
  738. * SHOW VARIABLES dumped core on \v(sexpression) and \v(svalue).
  739. * Spurious refusals of remote directory listings if the remote
  740. server's date was set in the past.
  741. * In AIX, and maybe elsewhere too, Kermit's COPY command always
  742. failed with "Source and destination are the same file" when the
  743. destination file didn't exist.
  744. * The VMS version of C-Kermit did not work in Batch or when SPAWN'd.
  745. To compound the problem, it also pretty much ignored the -B and -z
  746. command-line options, whose purpose is to work around such
  747. problems.
  748. * C-Kermit 8.0 could not be built on IRIX 5.x.
  749. * The C-Kermit 8.0 build for QNX6 said it was an "(unknown version)".
  750. Other fixes are listed in the [172]previous section.
  751. [ [173]Top ] [ [174]Contents ] [ [175]C-Kermit ] [ [176]Kermit Home ]
  752. 2. SSH AND HTTP
  753. 2.1. SSH Connections
  754. This section does not apply to [177]Kermit 95 2.0, which has its own
  755. built-in SSH client, which is documented [178]SEPARATELY.
  756. On most UNIX platforms, C-Kermit can make SSH (Secure SHell) connection
  757. by running the external SSH command or program through its
  758. pseudoterminal interface. The command is:
  759. SSH text
  760. Tells Kermit to start the external SSH client, passing the given
  761. text to it on the command line. Normally the text is just the
  762. hostname, but it can be anything else that is acceptable to the
  763. ssh client. If the command succeeds, the connection is made and
  764. Kermit automatically enters CONNECT (terminal) mode. You can use
  765. the SSH command to make a connection to any host that has an SSH
  766. server.
  767. Kermit's SSH command gives you all the features of Kermit on an SSH
  768. connection: command language, file transfer, character-set translation,
  769. scripting, and all the rest. By default, C-Kermit invokes SSH with "-e
  770. none", which disables the ssh escape character and makes the connection
  771. transparent for purposes of file transfer. You can, however, change the
  772. SSH invocation to whatever else you might need (an explicit path,
  773. additional command-line arguments, etc) with:
  774. SET SSH COMMAND text
  775. Specifies the system command that Kermit's SSH command should
  776. use to invoke the external SSH client. Use this command to
  777. supply a specific path or alternative name, or to include
  778. different or more command-line options.
  779. In most cases, these connections work quite well. They can be scripted
  780. like any other connection, and file transfer goes as fast as, or faster
  781. than, on a regular Telnet connection. In some cases, however, the
  782. underlying pseudoterminal driver is a limiting factor, resulting in
  783. slow or failed file transfers. Sometimes you can work around such
  784. problems by reducing the Kermit packet length. Note that Kermit does
  785. not consider SSH connections to be reliable, so it does not offer to
  786. use streaming in Kermit protocol transfers (but you can force it with
  787. SET RELIABLE or SET STREAMING if you wish).
  788. The SSH command is like the TELNET command: it enters CONNECT mode
  789. automatically when the connection is made. Therefore, to script an SSH
  790. connection, use:
  791. set host /pty ssh -e none [ other-options ] host
  792. if fail ...
  793. to make the connection.
  794. Here's a sequence that can be used to make a connection to a given host
  795. using Telnet if the host accepts it, otherwise SSH:
  796. if not defined \%1 exit 1 Usage: \%0 host
  797. set quiet on
  798. set host \%1 23 /telnet
  799. if fail {
  800. set host /pty ssh -l \m(user) -e none \%1
  801. if fail exit 1 \%1: Telnet and SSH both fail
  802. echo SSH connection to \%1 successful
  803. } else {
  804. echo Telnet connection to \%1 successful
  805. }
  806. In SSH v2, it is possible to make an SSH connection direct to a Kermit
  807. server system if the host administrator has configured the SSH server
  808. to allow this.
  809. Since Kermit uses external ssh client software, and since there are
  810. different ssh clients (and different releases of each one), the exact
  811. command to be used to make an SSH/Kermit connection can vary. Here is
  812. the command for the OpenSSH 3.0.2p1 client:
  813. set host /pipe ssh -e none [ -l username ] -T -s hostname kermit
  814. Example:
  815. set host /pipe ssh -e none -l olga -T -s hq.xyzcorp.com kermit
  816. The SSH client might or might not prompt you for a password or other
  817. information before it makes the connection; this depends on your SSH
  818. configuration (your public and private keys, your authorized hosts
  819. file, etc). Here's a brief synopsis of the OpenSSH client command
  820. syntax ("man ssh" for details):
  821. -e none
  822. This tells the SSH client to use no escape character. Since we
  823. will be transferring files across the connection, we don't want
  824. the connection to suddenly block because some character in the
  825. data.
  826. -l username
  827. This is the username on the remote host. You can omit the -l
  828. option and its argument if your local and remote usernames are
  829. the same. If they are different, you must supply the remote
  830. username.
  831. -T
  832. This tells the SSH client to tell the SSH server not to allocate
  833. a pseudoterminal. We are not making a terminal connection, we
  834. don't need a terminal, and in fact if a terminal were allocated
  835. on the remote end, the connection would not work.
  836. -s ... kermit
  837. This tells the SSH client to tell the SSH server to start the
  838. specified subsystem ("kermit") once the connection is made. The
  839. subsystem name comes after the hostname.
  840. hostname
  841. The IP host name or address of the desired host.
  842. You might want to include other or additional ssh command-line options;
  843. "man ssh" explains what they are. Here are some examples for the
  844. OpenSSH 3.0.2p1 client:
  845. -oClearAllForwardings yes
  846. -oForwardAgent no
  847. -oForwardX11 no
  848. -oFallbackToRsh no
  849. These ensure that a secure connection is used and that the
  850. connection used for file transfer is not also used for
  851. forwarding other things that might be specified in the
  852. ssh_config file.
  853. -oProtocol 2
  854. (i.e. SSH v2) Ensures that the negotiated protocol supports
  855. subsystems.
  856. Once you have an SSH connection to a Kermit server, it's just like any
  857. other connection to a Kermit server (and very similar to a connection
  858. to an FTP server). You give the client file transfer and management
  859. commands for the server, and the server executes them. Of course you
  860. can also give the client any other commands you wish.
  861. [ [180]SSH Kermit Server Subsystem ] [ [181]Kermit 95 Built-in SSH
  862. Client ]
  863. 2.2. HTTP Connections
  864. Hypertext Transfer Protocol, or HTTP, is the application protocol of
  865. the World Wide Web (WWW), used between Web browsers (clients) and Web
  866. servers. It allows a client to get files from websites, upload files to
  867. websites, delete files from websites, get information about website
  868. directories and files, and interact with server-side CGI scripts.
  869. C-Kermit includes an HTTP client capable of both clear-text and secure
  870. HTTP connections, that can do all these tasks and can be automated
  871. through the Kermit scripting language.
  872. Although C-Kermit 7.0 could make HTTP connections to Web servers, it
  873. could do so only when no other connection was open, and the procedure
  874. was somewhat awkward. C-Kermit 8.0 improves matters by:
  875. * Allowing an HTTP connection to be open at the same time as a
  876. regular SET LINE or SET HOST connection, and also at the same time
  877. as an FTP connection ([182]Section 3);
  878. * Upgrading the HTTP protocol level from 1.0 to 1.1, thus allowing
  879. for persistent connections, in which a series of commands can be
  880. sent on the same connection, rather than only one as in HTTP 1.0
  881. (and C-Kermit 7.0);
  882. * Providing for "one-shot" URL-driven HTTP operations such as GET or
  883. PUT.
  884. * Providing a distinct HTTP command-line personality.
  885. Persistent HTTP connections are managed with the following commands:
  886. HTTP [ switches ] OPEN [ security-options ] host-or-url [ port ]
  887. Opens a persistent connection to the specified host (IP host
  888. name or address) on the specified port. If any switches
  889. (options, listed in the next section) are included, their values
  890. are saved and used for all subsequent HTTP action commands on
  891. the same connection. If no port is specified, HTTP (80) is used.
  892. A Uniform Resource Locator (URL, [183]RFC 1738) can be given
  893. instead of a hostname (or address) and port (but the URL can not
  894. include a directory/file path). The security options are
  895. explained [184]below. The HTTP OPEN command replaces the
  896. C-Kermit 7.0 SET HOST hostname HTTP command, which no longer
  897. works with HTTP GET and related commands.
  898. HTTP CLOSE
  899. Closes any open HTTP connection and clears any saved switch
  900. values.
  901. A URL starts with a protocol name, which must be http or https in this
  902. case; optionally includes a username and password; and must contain a
  903. host name or address:
  904. protocol://[user[.password]]@host[:port][URI]
  905. HTTP is Hypertext Transfer Protocol. HTTPS is the secure (SSL/TLS)
  906. version of HTTP. The TCP service port is derived from the protocol
  907. prefix (so normally the ":port" field is omitted). Thus the URL
  908. protocol name specifies a default TCP service port and the URL user and
  909. password fields can take the place of the /USER and /PASSWORD switches
  910. ([185]Section 2.2.1). The optional URI is a "compact string of
  911. characters for identifying an abstract or physical resource" ([186]RFC
  912. 2396), such as a file. It must begin with a slash (/); if the URI is
  913. omitted, "/" is supplied. Examples:
  914. http open http://www.columbia.edu/
  915. Equivalent to http open www.columbia.edu or http open
  916. www.columbia.edu http.
  917. http open https://olga.secret@www1.xyzcorp.com/
  918. Equivalent to http /user:olga /pass:secret open www1.xyzcorp.com
  919. https.
  920. Persistence is accomplished unilaterally by C-Kermit 8.0. An HTTP 1.0
  921. server closes the connection after each action. Although HTTP 1.1
  922. allows multiple actions on the same connection, an HTTP 1.1 server
  923. tends to close the connection if it is idle for more than a few
  924. seconds, to defend itself against denial-of-service attacks. But when
  925. you use Kermit's HTTP OPEN command to create a connection, Kermit
  926. reopens it automatically (if necessary) for each HTTP action until you
  927. close it with HTTP CLOSE, regardless of the server's HTTP protocol
  928. version, or how many times it closes the connection.
  929. Firewalls can be negotiated through proxies with the following
  930. commands:
  931. SET TCP HTTP-PROXY [ host[:port] ]
  932. If a host (by hostname or IP address) is specified, Kermit uses
  933. it as a proxy server when attempting outgoing TCP connections --
  934. not only HTTP connections, but all TCP/IP connections, Telnet
  935. and FTP included. This allows Kermit to adapt to the HTTP
  936. firewall penetration method (as opposed to other methods such as
  937. SOCKS4). If no hostname or ip-address is specified, any
  938. previously specified Proxy server is removed. If no port number
  939. is specified, the "http" service is used. This command must be
  940. given before the HTTP OPEN command if a proxy is to be used or
  941. canceled.
  942. HTTP [ switches ] CONNECT host[:port]
  943. Instructs the HTTP server to act as a proxy, establishing a
  944. connection to the specified host (IP hostname or address) on the
  945. given port (80 = HTTP by default) and to redirect all data
  946. transmitted between Kermit and itself to the given host for the
  947. life of the connection. This command is to be used only for
  948. debugging HTTP proxy connections. If a proxy connection is
  949. required, instruct Kermit to use the proxy with the SET TCP
  950. HTTP-PROXY command.
  951. 2.2.1. HTTP Command Switches
  952. HTTP switches, like all other switches, are optional. When HTTP
  953. switches are included with the HTTP OPEN command, they apply
  954. automatically to this and all subsequent HTTP actions (GET, PUT, ...)
  955. on the same connection until an HTTP CLOSE command is given. So if you
  956. include switches (or the equivalent URL fields, such as user and
  957. password) in the HTTP OPEN command, you can omit them from subsequent
  958. commands on the same connection. If the connection has closed since
  959. your last command, it is automatically reopened with the same options.
  960. If you include switches with an HTTP action command (such as GET or
  961. PUT), they apply only to that command.
  962. /USER:name
  963. To be used in case a page requires a username for access. The
  964. username is sent with page requests. If it is given with the
  965. OPEN command it is saved until needed. If a username is included
  966. in a URL, it overrides the username given in the switch.
  967. CAUTION: Username and password (and all other information,
  968. including credit card numbers and other material that you might
  969. prefer to protect from public view) are sent across the network
  970. in clear text on regular HTTP connections, but authentication is
  971. performed securely on HTTPS connections.
  972. /PASSWORD:text
  973. To be used in case a web page requires a password for access.
  974. The password is sent with page requests. If it is given with the
  975. OPEN command it is saved until needed. If a password is given in
  976. a URL, it overrides the one given here. CAUTION: (same as for
  977. /USER:).
  978. /AGENT:user-agent
  979. Identifies the client to the server. Overrides the default agent
  980. string, which is "C-Kermit" (for C-Kermit) or "Kermit-95" (for
  981. Kermit 95).
  982. /ARRAY:array-designator
  983. Tells Kermit to store the response headers in the given array,
  984. one line per element. The array need not be declared in advance.
  985. Example: /array:&a.
  986. /TOSCREEN
  987. Tells Kermit to display any response text on the screen. It
  988. applies independently of the output file specification; thus it
  989. is possible to have the server response go to the screen, a
  990. file, both, or neither.
  991. /HEADER:header-item(s)
  992. Used for specifying any optional headers to be sent with HTTP
  993. requests.
  994. /HEADER:tag:value
  995. To send more than one header, use braces for grouping:
  996. /HEADER:{{tag:value}{tag:value}...}
  997. For a list of valid tags and value formats see [187]RFC 2616,
  998. "Hypertext Transfer Protocol -- HTTP/1.1". A maximum of eight
  999. headers may be specified.
  1000. 2.2.2. HTTP Action Commands
  1001. HTTP actions can occur within a persistent connection, or they can be
  1002. self-contained ("connectionless"). A persistent HTTP connection begins
  1003. with an HTTP OPEN command, followed by zero or more HTTP action
  1004. commands, and is terminated with an HTTP CLOSE command:
  1005. http open www.columbia.edu
  1006. if failure stop 1 HTTP OPEN failed: \v(http_message)
  1007. http get kermit/index.html
  1008. if failure stop 1 HTTP GET failed: \v(http_message)
  1009. (more actions possible here...)
  1010. http close
  1011. A self-contained HTTP action occurs when a URL is given instead of a
  1012. remote file name to an HTTP action command. In this case, Kermit makes
  1013. the HTTP connection, takes the action, and then closes the connection.
  1014. If an HTTP connection was already open, it is closed silently and
  1015. automatically.
  1016. http get http://www.columbia.edu/kermit/index.html
  1017. Kermit's HTTP action commands are as follows. Switches may be included
  1018. with any of these to override switch (or default) values given in the
  1019. HTTP OPEN command.
  1020. HTTP [ switches ] GET remote-filename [ local-filename ]
  1021. Retrieves the named file from the server specified in the most
  1022. recent HTTP OPEN command for which a corresponding HTTP CLOSE
  1023. command has not been given. The filename may not include
  1024. wildcards (HTTP protocol does not support them). If no HTTP OPEN
  1025. command is in effect, this form of the HTTP GET command fails.
  1026. The default local filename is the same as the remote name, but
  1027. with any pathname stripped. For example, the command http get
  1028. kermit/index.html stores the file in the current local directory
  1029. as index.html. If the /HEADERS: switch is included, information
  1030. about the file is also stored in the specified array (explained
  1031. in [188]Section 2.2.3). All files are transferred in binary
  1032. mode. HTTP does not provide for record-format or character-set
  1033. conversion.
  1034. HTTP [ switches ] GET url [ local-filename ]
  1035. When HTTP GET is given a URL rather than a filename, Kermit
  1036. opens a connection to the designated server (closing any
  1037. previously open HTTP connection), gets the file, and then closes
  1038. the connection. If the URL does not include a filename,
  1039. index.html is supplied. This is the self-contained one-step
  1040. "connectionless" method for getting a file from a Web server.
  1041. The data is not interpreted; HTTP GET is like "lynx -source"
  1042. rather than "lynx -dump".
  1043. In the remaining HTTP action commands, the distinction between a remote
  1044. filename and a URL are the same as in the HTTP GET command.
  1045. HTTP [ switches ] HEAD remote-filename-or-url [ local-filename ]
  1046. Like GET except without actually getting the file; instead it
  1047. retrieves only the headers. If the /ARRAY: or /TOSCREEN switch
  1048. is included, there is no default local output filename but you
  1049. can still specify one. If neither of these switches is included,
  1050. the default local filename is the same as the remote filename,
  1051. but with any path stripped and with ".head" appended. The HEAD
  1052. command can be used in a script with the /ARRAY: switch to
  1053. retrieve information about the requested resource to determine
  1054. whether the resource should actually be retrieved with a
  1055. subsequent GET request.
  1056. HTTP [ switches ] INDEX remote-directory-or-url [ local-filename ]
  1057. Asks the server to send a listing of the files in the given
  1058. server directory. This command is not supported by most Web
  1059. servers. Even when it is supported, there is no standard format
  1060. for the listing.
  1061. HTTP [ switches ] POST [ /MIME-TYPE:type ] source-file
  1062. remote-path-or-url [ result-file ]
  1063. Sends data to a process running on the remote host; the result
  1064. is usually an HTML file but could be anything. The data to be
  1065. posted must be read from a local file (the source-file). If a
  1066. result file is specified, Kermit stores the server's response in
  1067. it.
  1068. HTTP [ switches ] PUT [ MIME-TYPE:type ] local-file [
  1069. remote-file-or-url [ result-file ] ]
  1070. Uploads a local file to the server. Only the name of a single
  1071. file can be given; wildcards (and group transfers) are not
  1072. supported by HTTP protocol. If no remote filename is given, the
  1073. file is sent with the same name as the local file, but with any
  1074. pathname stripped.
  1075. HTTP [ switches ] DELETE remote-file-or-url [ local-result-file ]
  1076. Asks the server to delete the specified single file. If a result
  1077. file is specified, it will contain any response data returned by
  1078. the server.
  1079. Note the limitations of HTTP protocol compared to (say) FTP or Kermit.
  1080. There is no command for changing directories, no standard way to get
  1081. file or directory lists, no way to transfer file groups by using
  1082. wildcard notation, etc, and therefore no good way to (say) fetch all
  1083. pages, descend through subdirectories, perform automatic updates, etc.
  1084. There is no assurance a connection will stay open and, as noted, there
  1085. is no provision for data conversion between unlike platforms. The
  1086. data's MIME headers can be used for postprocessing.
  1087. 2.2.3. HTTP Headers
  1088. Each HTTP request and response contains a set of name/value pairs
  1089. called headers. HTTP headers are specified in [189]RFC 2616. For
  1090. example, an HTTP GET request for /index.html on www.columbia.edu
  1091. contains the following headers:
  1092. GET /index.html HTTP/1.1
  1093. Host: www.columbia.edu:80
  1094. User-agent: C-Kermit 8.0
  1095. Authorization: Basic base64-encoded-username-password
  1096. These might be followed by any others specified with a /HEADERS:
  1097. switch:
  1098. Accept: image/gif, image/x-xbitmap, image/jpeg, *.*
  1099. Accept-Encoding: gzip
  1100. Accept-Language: en
  1101. Accept-Charset: iso-8859-1,utf-8
  1102. Cookie: cookie-data
  1103. The server sends back a short report about the file prior to sending
  1104. the file contents. Example:
  1105. HTTP/1.1 200 OK
  1106. Date: Fri, 24 Aug 2001 21:09:39 GMT
  1107. Server: Apache/1.3.4 (Unix)
  1108. Last-Modified: Mon, 06 Aug 2001 21:16:13 GMT
  1109. ETag: "1fa137-10d7-3b6f091d"
  1110. Accept-Ranges: bytes
  1111. Content-Length: 4311
  1112. Content-Type: text/html
  1113. If you want to have this information available to a Kermit script you
  1114. can use the /ARRAY switch to have Kermit put it in array, one line per
  1115. array element. Example:
  1116. set exit warning off
  1117. http open www.columbia.edu
  1118. if fail exit 1 Can't reach server
  1119. http /array:&a get /index.html
  1120. if fail exit 1 Can't get file
  1121. echo Header lines: \fdim(&a)
  1122. for \%i 1 \fdim(&a) 1 {
  1123. echo \%i. \&a[\%i]
  1124. }
  1125. Note that the "Date:" item is the current date and time; the
  1126. "Last-Modified:" item is the file's modification date and time. An
  1127. example showing how to use this information is presented in
  1128. [190]Section 8.13.7.
  1129. 2.2.4. Secure HTTP Connections
  1130. SSL/TLS (Secure Sockets Layer / Transport Layer Security) is the
  1131. protocol used to secure HTTP, SMTP, and other Internet applications.
  1132. See the [191]C-Kermit Reference Section 5.4 for an introduction to
  1133. SSL/TLS. To make a secure HTTP connection, you need:
  1134. 1. A secure client (a version of C-Kermit or Kermit 95 with SSL/TLS
  1135. security built in). Type "check ssl" at the Kermit prompt to make
  1136. sure you have it.
  1137. 2. A secure server to connect to.
  1138. 3. The CA Root Certificate used to authenticate the server to the
  1139. client. (see [192]Section 15 of the security reference for an
  1140. introduction to certificates).
  1141. And you must make a connection to the secure HTTP port: service name
  1142. HTTPS, port number 443 (as opposed to service HTTP, port 80). You can
  1143. also make secure connections to other ports by including the /TLS or
  1144. /SSL switch with the HTTP OPEN command, if the host supports SSL/TLS on
  1145. the given port:
  1146. The quality of the SSL/TLS connection depends on the cipher suite.
  1147. There are several possibilities:
  1148. Anonymous cipher suite:
  1149. If an anonymous cipher suite is negotiated, the connection is
  1150. encrypted but there is no authentication. This connection is
  1151. subject to a Man-In-The-Middle (MITM) attack.
  1152. X.509 certificate on the server:
  1153. When you connect to certain secure servers, an X.509 certificate
  1154. is returned. This certificate is issued to a special hostname,
  1155. something like www1.xyzcorp.com or wwws.xyzcorp.com (rather than
  1156. the normal www.xyzcorp.com). It is signed by the host's
  1157. Certificate Authority (CA). If the host certificate is
  1158. configured on the client, it can be used to verify the
  1159. certificate received from the server. If the certificate it
  1160. verified as authentic, a check is made to ensure it has not
  1161. expired and it was issued to the host you were attempting to
  1162. connect to. If you had asked to connect to (say) www.xyzcorp.com
  1163. but were given a certificate for www1.xyzcorp.com, you would be
  1164. prompted for permission to continue.
  1165. If the verification succeeded, the connection would be encrypted
  1166. with one-way (server-to-client) authentication. This connection
  1167. is not subject to a MITM attack.
  1168. If a username and password are transmitted over this connection,
  1169. they are not subject to interception. However, the standard
  1170. risks associated with passing the password to the host for
  1171. verification apply; for example, if the host has been
  1172. compromised, the password will be compromised.
  1173. X.509 client certificate:
  1174. If a connection has been established with an X.509 server
  1175. certificate, the server can ask the client to send a certificate
  1176. of its own. This certificate must be verified against a CA Root
  1177. certificate. The certificate itself (or subject info from the
  1178. certificate) is used to determine the authorization for the
  1179. client, and if successful, the username and password need not be
  1180. sent to the server.
  1181. Kerberos 5:
  1182. Instead of using X.509 certificates, Kerberos 5 can be used to
  1183. perform the authentication and key exchange. In this situation,
  1184. there is mutual authentication between the client and server.
  1185. The Kerberos 5 principal is used by the server to look up the
  1186. appropriate authorization data. There is no need to send
  1187. username and password.
  1188. An HTTP connection is made with the HTTP OPEN command:
  1189. HTTP [ switches ] OPEN [ { /SSL, /TLS } ] host [ port ]
  1190. If /SSL or /TLS switches are included (these are synonyms), or
  1191. if the service is HTTPS or the port is 443, a secure connection
  1192. is attempted using the current authentication settings; see HELP
  1193. SET AUTHENTICATION for details ([193]Section 6.2 of the security
  1194. reference). If the no /SSL or /TLS switch is included but the
  1195. port is 443 or the service is HTTPS, a secure connection is
  1196. attempted. If an /SSL or /TLS switch is included but a port is
  1197. not specified, an SSL/TLS connection is attempted on the default
  1198. port (80).
  1199. Certificates are covered in the separate [194]Kermit Security Reference
  1200. for C-Kermit 8.0. You should let Kermit know to verify certificates
  1201. with the SET AUTHENTICATION TLS command. For example:
  1202. SET AUTHENTICATION TLS CRL-DIR directory
  1203. Specifies a directory that contains certificate revocation files
  1204. where each file is named by the hash of the certificate that has
  1205. been revoked.
  1206. SET AUTHENTICATION TLS CRL-FILE filename
  1207. Specifies a file that contains a list of certificate
  1208. revocations.
  1209. SET AUTHENTICATION TLS VERIFY-DIR directory
  1210. Specifies a directory that contains root CA certificate files
  1211. used to verify the certificate chains presented by the peer.
  1212. Each file is named by a hash of the certificate.
  1213. SET AUTHENTICATION TLS VERIFY-FILE filename
  1214. Specifies a file that contains root CA certificates to be used
  1215. for verifying certificate chains.
  1216. SET AUTHENTICATION TLS VERIFY OFF
  1217. Tells Kermit not to require a certificate and accept any
  1218. certificate that is presented regardless of whether it is valid.
  1219. There are many other options; see the security document for details.
  1220. Now suppose you need need to fetch the file denoted by the following
  1221. URL:
  1222. https://myuserid:mypassword@wwws.xyzcorp.com/clients/info/secret.html
  1223. Once you have set up the handling of certificates as desired, you can
  1224. use the following Kermit commands:
  1225. http /user:myuserid /password:mypassword open www1.xyzcorp.com https
  1226. if success {
  1227. http get /clients/info/secret.html
  1228. http close
  1229. }
  1230. As another example, let's say that you have a web form you need to
  1231. populate with three fields: red,white and blue.
  1232. <FORM ACTION="http://www.xyzcorp.com/cgi-bin/form.cgi" METHOD="POST">
  1233. <INPUT NAME="Red">
  1234. <INPUT NAME="White">
  1235. <INPUT NAME="Blue">
  1236. </FORM>
  1237. You can handle this with the HTTP POST command. The data to be posted
  1238. is stored in the local file data.txt.
  1239. Red=seven stripes&White=six stripes&Blue=fifty stars
  1240. and the response from the server will be stored into response.txt.
  1241. http open www.xyzcorp.com http
  1242. if success {
  1243. http /array:c post data.txt /cgi-bin/form.cgi response.txt
  1244. http close
  1245. }
  1246. In this scenario, the Common Gateway Interface (CGI) sends a response
  1247. whether it succeeds or fails in a script-dependent manner. The script
  1248. can either report success and enclose the response data; or it might
  1249. send a 302 Found error which indicates that the "Location:" header
  1250. should be used to determine the URL at which the data can be found.
  1251. 2.2.5. HTTP Variables
  1252. \v(http_code)
  1253. The HTTP protocol code number of the most recent server reply,
  1254. e.g. 404 for "not found".
  1255. \v(http_connected)
  1256. 1 when an HTTP connection is open, 0 when there is no HTTP
  1257. connection.
  1258. \v(http_host)
  1259. If an HTTP connection is open, the hostname:port, e.g.
  1260. www.columbia.edu:80; otherwise, empty.
  1261. \v(http_message)
  1262. Server error message, if any, from most recent HTTP command.
  1263. \v(http_security)
  1264. A list of the security parameters and values for the current
  1265. connection, if any. Empty if the connection is not to a secure
  1266. server, or there is no connection.
  1267. To display all the HTTP variables at once, type SHOW VAR HTTP:
  1268. C-Kermit> http open www.columbia.edu
  1269. C-Kermit> http get lkjlkjlkjlkj
  1270. C-Kermit> sho var http
  1271. \v(http_code) = 404
  1272. \v(http_connected) = 1
  1273. \v(http_host) = www.columbia.edu:80
  1274. \v(http_message) = Not Found
  1275. \v(http_security) = NULL
  1276. C-Kermit>
  1277. 2.2.6. The HTTP Command-Line Personality
  1278. If you invoke C-Kermit with the name "http" or "https", you can use a
  1279. special set of HTTP-specific command-line options. You can do this by
  1280. creating a symbolic linke "http" or "https" to the C-Kermit 8.0
  1281. executable, or by having a separate copy of it called "http" or
  1282. "https". Here's the usage message ("http -h"):
  1283. Usage: ./http host [ options... ]
  1284. -h This message.
  1285. -d Debug to debug.log.
  1286. -S Stay (issue command prompt when done).
  1287. -Y Do not execute Kermit initialization file.
  1288. -q Quiet (suppress most messages).
  1289. -u name Username.
  1290. -P password Password.
  1291. -g pathname Get remote pathname.
  1292. -p pathname Put remote pathname.
  1293. -H pathname Head remote pathname.
  1294. -l pathname Local path for -g, -p, and -H.
  1295. -z opt[=value] Security options...
  1296. cert=file Client certificate file
  1297. certsok Accept all certificates
  1298. key=file Client private key file
  1299. secure Use SSL
  1300. verify=n 0 = none, 1 = peer , 2 = certificate required
  1301. The "host" argument is the name of a Web host, e.g. www.columbia.edu.
  1302. The action options are -p, -g, and -H. If you give an action option,
  1303. Kermit does the action and then exits. If you give a host without an
  1304. action option, Kermit makes an HTTP connection to the host and then
  1305. gives you the C-Kermit prompt. Here's a simple example that fetches a
  1306. publicly readable Web page:
  1307. http www.columbia.edu -g kermit/index.html
  1308. If you need to access a website for which a username and password are
  1309. required, you can supply them on the command line with -u and -P. If
  1310. you include a username but omit the password, Kermit prompts you for
  1311. it:
  1312. http www.columbia.edu -u olga -p kermit/index.html -l index.html
  1313. Password:
  1314. Note that when PUT'ing files to websites, you have to supply both the
  1315. -p (remote pathname) and -l (local path) options.
  1316. If your version of Kermit is built with SSL/TLS security, you can also
  1317. use the -z option to make secure HTTP (https) connections.
  1318. Finally, as noted in [195]Section 16, you can also give a URL instead
  1319. of a host name and options.
  1320. [ [196]Top ] [ [197]Contents ] [ [198]C-Kermit Home ] [ [199]Kermit
  1321. Home ]
  1322. 3. KERMIT'S BUILT-IN FTP CLIENT
  1323. 3.1. [200]Making and Managing FTP Connections
  1324. 3.2. [201]Making Secure FTP Connections
  1325. 3.3. [202]Setting FTP Preferences
  1326. 3.4. [203]Managing Directories and Files
  1327. 3.5. [204]Uploading Files With FTP
  1328. 3.6. [205]Downloading Files With FTP
  1329. 3.7. [206]Translating Character Sets
  1330. 3.8. [207]FTP Command Shortcuts
  1331. 3.9. [208]Dual Sessions
  1332. 3.10. [209]Automating FTP Sessions
  1333. 3.11. [210]Advanced FTP Protocol Features
  1334. Earlier versions of C-Kermit and K95 included an FTP command, but it
  1335. simply invoked an external FTP client. Now, by popular demand, Kermit
  1336. includes its own built-in FTP client that offers the following
  1337. advantages over traditional FTP clients (and its previous interface to
  1338. them):
  1339. * Any of Kermit's built-in [211]security methods can be used to
  1340. establish and conduct secure FTP sessions with [212]FTP servers
  1341. that support these methods. (Security modules can be subject to
  1342. export restrictions.)
  1343. * Kermit's FTP client uses "passive mode" by default to avoid
  1344. blockage by firewalls and network address translators. Of course
  1345. active mode can be chosen too when needed.
  1346. * [213]Character sets can be translated as part of the transfer
  1347. process even when the FTP server does not support character-set
  1348. translation, including to/from the new Internet standard
  1349. international character set, [214]Unicode UTF-8. This includes both
  1350. the file's name and (for text files only) its contents.
  1351. * All of C-Kermit's [215]file-selection mechanisms are available:
  1352. size, date, name patterns and lists, exception lists, etc.
  1353. * [216]Atomic file movement capabilities are provided (delete, move,
  1354. or rename files automatically after successful transfer).
  1355. * The correct file type, "ascii" (i.e. text) or binary, is chosen
  1356. automatically for each file (explained in [217]Section 4), and any
  1357. mixture of text and binary files can be sent in a single operation,
  1358. even across platforms.
  1359. * Update mode ("don't bother transferring files that didn't change
  1360. since last time") and recovery (resumption of an interrupted
  1361. transfer from the point of failure) are available in both
  1362. directions.
  1363. * When uploading files from UNIX to UNIX, the file's permissions can
  1364. be preserved if desired.
  1365. * Recursive directory-tree PUTs are supported between any two
  1366. platforms that have tree-structured file systems. Recursive GETs
  1367. are supported between like platforms if the server cooperates and
  1368. between like or unlike platforms if the server supports MLSD
  1369. ([218]Section 3.11).
  1370. * When receiving files, all of Kermit's file collision actions are
  1371. available: backup, update, refuse, rename, etc.
  1372. * Multi-file transfers can be interrupted on a per-file basis,
  1373. automatically skipping to the next file.
  1374. * FTP sessions are [219]fully scriptable.
  1375. * An entire FTP session (connect, login, CD, upload or download,
  1376. logout) can be specified on the command line without using a
  1377. script.
  1378. * All of Kermit's logging options and formats are available to keep
  1379. an accurate and complete record of each connection and file
  1380. transfer, and to aid in troubleshooting.
  1381. * All of Kermit's file-transfer display options are available
  1382. (fullscreen, brief, CRT, serial, none).
  1383. And best of all:
  1384. * Kermit doesn't give you those annoying per-file prompts every time
  1385. you start a multi-file transfer without remembering to give a
  1386. "prompt" command first :-).
  1387. [ [220]Top ] [ [221]FTP Top ] [ [222]FTP Client Overview ] [ [223]FTP
  1388. Script Tutorial ] [ [224]C-Kermit Home ] [ [225]Kermit Home ]
  1389. 3.1. Making and Managing FTP Connections
  1390. Each copy of Kermit can have one FTP connection open at a time. FTP
  1391. connections are independent of regular terminal connections; a terminal
  1392. connection (serial or network via SET LINE, DIAL, SET HOST, TELNET,
  1393. etc) may be, but need not be, open at the same time as an FTP
  1394. connection, and terminal connections can also be closed, and new
  1395. connections opened, without interfering with the FTP connection (and
  1396. vice versa). Thus, for example, Kermit can have an FTP connection and a
  1397. TELNET connection open to the same host simultaneously, using the
  1398. TELNET connection (e.g.) to send mail or take other desired actions as
  1399. various FTP actions complete. Of course, each copy of Kermit can do
  1400. only one thing at a time, so it can't (for example) transfer a file
  1401. with FTP and another file with Kermit protocol simultaneously.
  1402. A Kermit FTP session can be established by [226]command-line options,
  1403. by [227]URL, or by [228]interactive commands.
  1404. 3.1.1. Kermit Command-Line Options for FTP
  1405. The new command-line option '-9' (sorry, we're out of letters) can be
  1406. used when starting C-Kermit, telling it to make an FTP connection:
  1407. kermit -9 hostname
  1408. or if a non-default FTP port is needed:
  1409. kermit -9 hostname:port
  1410. You can also specify the username on the command line with the -M ("My
  1411. User ID") option that was already there for other connection types:
  1412. kermit -9 hostname -M olga
  1413. If you specify the username on the command line, Kermit uses it when
  1414. making the connection and does not prompt you for it (but it does
  1415. prompt you for the password if one is required).
  1416. Once the connection is made, you get the regular Kermit prompt, and can
  1417. give interactive commands such as the ones described below. When you
  1418. give a BYE command, Kermit closes the session and exits, just as a
  1419. regular FTP client would do. If you don't want Kermit to exit when you
  1420. give a BYE command, include the -S ("Stay") option on the command line.
  1421. Other Kermit command-line options that are not specific to non-FTP
  1422. connections should affect the FTP session in the expected ways; for
  1423. example, -i and -T force binary and text mode transfers, respectively.
  1424. File transfers can not be initiated on the "kermit -9" command line;
  1425. for that you need to use Kermit's FTP personality (next section) or you
  1426. can use URLs ([229]Section 3.1.3).
  1427. 3.1.2. The FTP Command-Line Personality
  1428. If you want to replace your regular FTP client with C-Kermit, you can
  1429. make a link called "ftp" to the C-Kermit binary (or you can store a
  1430. copy of the C-Kermit binary under the name "ftp"). When C-Kermit is
  1431. invoked with a program name of "ftp" (or "FTP", case doesn't matter),
  1432. it assumes the command-line personality of the regular FTP client:
  1433. ftp [ options ] hostname [ port ]
  1434. In this case the options are like those of a regular FTP client:
  1435. -d Debug: enables debug messages and creates a debug.log file.
  1436. -n No autologin: Kermit should not send your user ID automatically.
  1437. -t Packet trace: accepted but is treated the same as -d.
  1438. -v Verbose: accepted but ignored (operation is verbose by default).
  1439. -i Not interactive: accepted but ignored.
  1440. and the hostname can also be a URL (explained in [230]Section 3.1.3).
  1441. To specify a non-default TCP port for the FTP server, include the port
  1442. number or name after the hostname.
  1443. There are also some bonus options that allow you to execute an entire
  1444. FTP session from the shell command line, as long as you don't include
  1445. the -n option. These are not available with regular FTP clients, and at
  1446. least one of these options (-g) conflicts with UNIX ftp (where -g means
  1447. "no globbing", which does not apply to Kermit), and some of them (like
  1448. the options above) also conflict with regular Kermit command-line
  1449. options:
  1450. -m mode = "passive" (default) or "active"
  1451. -Y Don't execute the Kermit initialization file [1]
  1452. -q Quiet, suppresses all but error messages [1]
  1453. -S Stay, don't exit automatically [1]
  1454. -A Autologin anonymously [2]
  1455. -u name Username for autologin [2] (synonym: -M [1])
  1456. -P password Password for autologin (see cautions below) [2]
  1457. -D directory cd after autologin [2]
  1458. -b Binary mode [2]
  1459. -a Text ("ascii") mode [2] (synonym: -T [1])
  1460. -R Recursive (works with -p) [4]
  1461. -p files Files to put (upload) after autologin [2] (synonym: -s [1])
  1462. -g files Files to get (download) after autologin [3]
  1463. [1] Same as Kermit, not available in regular FTP clients.
  1464. [2] Conflicts with Kermit, not available in regular FTP clients.
  1465. [3] Same as Kermit, conflicts with regular FTP clients.
  1466. [4] Conflicts with Kermit, available in some FTP clients.
  1467. Fancier options such as restart, character-set translation, filename
  1468. collision selection, automatic move/rename/delete, etc, are not
  1469. available from the command line; for these you can use the commands
  1470. described in the following sections. The -R option might also work with
  1471. -g (GET) but that depends on the server.
  1472. The following security options are also available, explained in
  1473. [231]Section 3.2:
  1474. -k realm Kerberos 4 realm [4]
  1475. -f Kerberos 5 credentials forwarding [4]
  1476. -x autoencryption mode [4]
  1477. -c cipher SRP cipher type [4]
  1478. -H hash SRP encryption hash [4]
  1479. -z option Security options [4]
  1480. If you include -A or specify a name of "anonymous" or "ftp", you are
  1481. logged in anonymously and, in the absence of -P, Kermit automatically
  1482. supplies a password of "user@host", where "user" is your local user ID,
  1483. and "host" is the hostname of the computer where Kermit is running. If
  1484. you do not include -p or -g, Kermit enters command mode so you can type
  1485. commands or execute them from a script.
  1486. If you include -p or -g, Kermit attempts to transfer the specified
  1487. files and then exits automatically at the end of the transfer unless
  1488. you also included -S (Stay). It uses the "brief" file transfer display
  1489. (one line per file) unless you include the -q option to suppress it.
  1490. When uploading files with -p, Kermit switches automatically between
  1491. text and binary mode for each file.
  1492. When downloading, you can either specify a particular mode (text or
  1493. binary) to be used for all the files, or you can let Kermit select the
  1494. type for each file automatically, based on its name (see [232]Sections
  1495. 3.5 and [233]3.6 for greater detail). In UNIX be sure to quote any
  1496. wildcard characters to prevent the shell from expanding them, as shown
  1497. in the examples just below. Filename collisions are handled according
  1498. Kermit's FILE COLLISION setting (if specified in your Kermit
  1499. customization file; otherwise the default, which is BACKUP).
  1500. It should go without saying that the -P option should be used with
  1501. caution. In addition to the well-known risks of transmitting plaintext
  1502. passwords over the Internet, in this case the password also echos to
  1503. the screen if you type it, and can be seen in ps and w listings that
  1504. show the user's currently active command and command-line arguments.
  1505. Thus command-line FTP sessions are most appropriate for secure or
  1506. anonymous connections (those that do not require passwords).
  1507. Here's an example in which you download the latest C-Kermit "tarball"
  1508. from the Columbia University FTP archive:
  1509. ftp -A kermit.columbia.edu -bg kermit/archives/ckermit.tar.gz
  1510. This assumes that "ftp" is a symbolic link to C-Kermit. It logs you in
  1511. anonymously and gets the ckermit.tar.gz file in binary mode from the
  1512. kermit/archives directory.
  1513. Here's a slightly more ambitious example that illustrates CD'ing to the
  1514. desired server directory to get a group of files in text mode (in this
  1515. case the C-Kermit source files):
  1516. ftp -A kermit.columbia.edu -D kermit/f -ag "ck[cuw]*.[cwh]" makefile
  1517. In this case we CD to the kermit/f directory so we don't have to
  1518. include it in each file specification, and we quote the ck[cuw]*.[cwh]
  1519. specification so the shell doesn't expand it, since we have to pass it
  1520. as-is to the server. Note also that the quotes don't go around the
  1521. entire file list; only around each file specification that needs to be
  1522. quoted.
  1523. Here's one more example, that uploads a debug log file in binary mode
  1524. to the Kermit incoming directory (as we might ask you to do when
  1525. following up on a problem report):
  1526. ftp -A kermit.columbia.edu -D kermit/incoming -bp debug.log
  1527. In this case the -D option is required to tell the server where to put
  1528. the incoming file.
  1529. Unless the -Y option is included, your Kermit initialization file
  1530. (.mykermrc in UNIX, K95.INI in Windows) is executed before the command
  1531. line options, so you can set any FTP-related preferences there, as
  1532. described in the subsequent sections.
  1533. 3.1.3. The FTP URL Interpreter
  1534. If Kermit is invoked with either its regular personality (as "kermit")
  1535. or its FTP personality (as "ftp"), you can also give a URL
  1536. (Universal Resource Locator) instead of a hostname and options,
  1537. with or without a username and password:
  1538. ftp ftp://user:password@host/path
  1539. ftp ftp://user@host/path
  1540. ftp ftp://@host/path (or ftp://:@host/path)
  1541. ftp ftp://host/path
  1542. kermit ftp://host/path
  1543. If the FTP personality is used, the service must be "ftp". In all
  1544. cases, a hostname or address must be included. If a user is included
  1545. but no password, you are prompted for the password. If a path
  1546. (filename) is included:
  1547. * If "@" is included without a user, Kermit prompts for the username
  1548. and password.
  1549. * If no user and no "@" are included, "anonymous" is used.
  1550. * GET is assumed.
  1551. If no path (and no action options) are included, an interactive FTP
  1552. session is started, as in this example:
  1553. ftp ftp://kermit.columbia.edu
  1554. If a path is included, but a username is not included, "anonymous" is
  1555. used and an appropriate user@host password is supplied automatically.
  1556. If authentication is successful, Kermit attempts to GET the file
  1557. indicated by the path or, if the path is the name of a directory, it
  1558. asks the server for a directory listing. In both cases, Kermit
  1559. disconnects from the server and exits after the operation is complete
  1560. (unless you have included the -S option on the command line).
  1561. Here's an example that gets a listing of the Kermit directory at the
  1562. Kermit ftp site:
  1563. ftp ftp://kermit.columbia.edu/kermit/
  1564. This example gets the top-level READ.ME file from the same directory:
  1565. ftp ftp://kermit.columbia.edu/kermit/READ.ME
  1566. Here's the same example, but requesting a text-mode transfer:
  1567. ftp -T ftp://kermit.columbia.edu/kermit/READ.ME
  1568. This illustrates that you can mix command-line options and URLs
  1569. if you desire.
  1570. Here's an example that logs in as a (fictitious) real user to get a
  1571. file:
  1572. ftp ftp://olga@ftp.xyzcorp.com/resume.txt
  1573. The password is not included, so Kermit prompts for it.
  1574. This scheme allows Kermit to be used as the FTP helper of other
  1575. applications, such as Web browsers, with all its advantages over other
  1576. FTP clients (especially the ones that are built in to most Web
  1577. browsers), e.g. that it can be given wildcards, and it can pick text
  1578. and binary mode automatically for each file.
  1579. HINT: suppose somebody sends you an FTP URL in email, or you see it in
  1580. some text. If your terminal screen supports copy/paste, copy the url,
  1581. and then at the shell prompt type "kermit", a space, and then paste the
  1582. URL, e.g.:
  1583. $ kermit ftp://alpha.greenie.net/pub/mgetty/source/1.1/mgetty1.1.27-O
  1584. "$ is the shell prompt; the part you type is underlined, the rest is
  1585. pasted in. Kermit does the rest.
  1586. 3.1.4. Interactive FTP Session Establishment
  1587. As you read this and the following sections, bear in mind that any
  1588. command that can be given at the prompt can also be used in a script
  1589. program. Kermit's script programming language is the same as its
  1590. interactive command language.
  1591. An FTP session is established with the FTP OPEN command:
  1592. FTP [ OPEN ] [ { /SSL, /TLS } ] hostname [ switches ] [ port ]
  1593. Opens an FTP connection to the given host on the given port and,
  1594. if FTP AUTOLOGIN is ON, also logs you in to the server,
  1595. prompting for username and password if necessary. If no port is
  1596. specified, the regular FTP protocol port (21) is used. The OPEN
  1597. keyword is optional (unless the hostname conflicts with one of
  1598. the FTP command keywords, which you can list by typing "ftp ?").
  1599. The hostname can be an IP host name, numeric IP address, or if you have
  1600. a network directory active (SET NETWORK DIRECTORY; see Chapter 6 of
  1601. [235]Using C-Kermit), an entry name in the directory. In the latter
  1602. case, if the given hostname matches exactly one entry, the associated
  1603. name or address is used; if it matches more than one, Kermit cycles
  1604. through them until one is found that can be opened; if it matches none,
  1605. then the hostname is used as-is. If a directory is active but you want
  1606. to bypass directory lookup, include an "=" sign at the beginning of the
  1607. hostname, and/or use a numeric IP address.
  1608. When an FTP connection is opened, the default file-transfer mode is set
  1609. to binary if the client and server platforms are alike (e.g. both of
  1610. them are some kind of UNIX), and to text ("ascii") if they are not
  1611. alike. This has no particular effect for uploading since Kermit
  1612. automatically switches between text and binary mode for each file, but
  1613. might be important for downloading. The connection is also set to
  1614. Stream mode and File structure. Record- or page-oriented file transfers
  1615. are not supported by C-Kermit's FTP client.
  1616. The optional FTP OPEN switches are:
  1617. /ANONYMOUS
  1618. Logs you in anonymously, automatically supplying username
  1619. "anonymous" and user@host as the password, based on your local
  1620. user and host names.
  1621. /NOLOGIN
  1622. Overrides SET FTP AUTOLOGIN ON for this connection only.
  1623. /USER:name
  1624. Uses the given username to log you in, thus avoiding the Name:
  1625. prompt.
  1626. Overrides SET FTP AUTOLOGIN OFF for this connection only.
  1627. /PASSWORD:text
  1628. Uses the given text as your password, thus avoiding the
  1629. Password: prompt. This switch is not recommended for use in
  1630. script files, which would be a security risk.
  1631. /ACCOUNT:text
  1632. Uses the given text as your account (or secondary password,
  1633. depending on the requirements of the server; most servers do not
  1634. require or accept an account name). If an account is not
  1635. supplied, you are not prompted for one.
  1636. /PASSIVE
  1637. Opens the connection in passive mode. Passive mode is the
  1638. default in Kermit's FTP client, unlike in most others, since it
  1639. works better through firewalls. The /PASSIVE and /ACTIVE
  1640. switches apply only to the connection that is being opened, and
  1641. do not affect the global FTP PASSIVE-MODE setting.
  1642. /ACTIVE
  1643. Opens the connection in active mode. Use this switch if the
  1644. server does not support passive mode, or use the command SET FTP
  1645. PASSIVE-MODE OFF.
  1646. /NOINIT
  1647. Added in C-Kermit 8.0.201. Tells C-Kermit not to send REST,
  1648. STRU, FEAT, and MODE commands to the server when the connection
  1649. is opened, since these have been reported to cause confusion in
  1650. certain servers.
  1651. When a username or password is missing, a prompt is issued at the
  1652. controlling terminal and you must type the response; the response can
  1653. not be scripted. Use the switches to avoid prompts, or one of the
  1654. secure authentication methods described in the next section, or see
  1655. [236]SET FTP AUTOLOGIN and the [237]FTP USER and similar commands
  1656. described later in this section.
  1657. Examples:
  1658. ftp open kermit.columbia.edu /anonymous ; Open and log in anonymously
  1659. ftp kermit.columbia.edu /anonymous ; The OPEN keyword can be omitted
  1660. ftp xyzcorp.com ; Open and maybe prompt for username
  1661. ftp xyzcorp.com /user:olga ; Open and log in as olga
  1662. ftp testing.abccorp.com 449 ; Specify a special TCP port number
  1663. ftp testing.abccorp.com /user:olaf /password:secret 449
  1664. The FTP OPEN command succeeds if a connection was opened to the server
  1665. (even if the given username and password were not valid) and fails
  1666. otherwise (see [238]Section 3.8 for details).
  1667. When your FTP session is complete, you can terminate it as follows:
  1668. FTP BYE
  1669. Closes the FTP connection if one was open. The FTP prefix can be
  1670. omitted if no other connection is open at the same time (see
  1671. [239]Section 3.8 for details). If a connection log is active, an
  1672. FTP record is written to it. If Kermit was started with the -9
  1673. command-line option or with its FTP command-line personality,
  1674. and the -S (Stay) option was not given, AND there is no other
  1675. active connection, the FTP BYE command also exits, just as it
  1676. does on a regular FTP client. Synonyms: FTP CLOSE, FTP QUIT (but
  1677. if the FTP prefix is omitted from QUIT, this becomes the regular
  1678. Kermit QUIT command, which is equivalent to EXIT; i.e. it closes
  1679. the connection and exits from Kermit).
  1680. The following commands can be used to achieve greater control over the
  1681. connection and login process:
  1682. SET FTP ANONYMOUS-PASSWORD text
  1683. Allows you to choose the password text to be sent automatically
  1684. by Kermit when you open an FTP connection with the /ANONYMOUS
  1685. switch.
  1686. SET FTP AUTOLOGIN { ON, OFF }
  1687. If you give this command prior to opening an FTP connection, it
  1688. controls whether Kermit tries to log you in automatically as
  1689. part of the connection process. Normally ON, which means the
  1690. username and password are sent automatically (and prompted for
  1691. if they are not yet known). When OFF, FTP OPEN connects to the
  1692. server without logging in. OFF is equivalent to the -n
  1693. command-line option when using Kermit's FTP command-line
  1694. personality.
  1695. FTP USER name [ password [ account ] ]
  1696. Used to log in to an FTP server to which a connection has been
  1697. made without autologin, or when autologin failed. If the
  1698. password is furnished on the command line, it is used; otherwise
  1699. you are prompted for a password. An account may also be
  1700. furnished if required by the server; it is not required by
  1701. Kermit and is not prompted for if omitted. Synonyms: USER, FTP
  1702. LOGIN.
  1703. FTP ACCOUNT text
  1704. Sends an account name to a server that supports accounts. If the
  1705. server does not support accounts, an error response occurs. If
  1706. the server does support accounts, the account is accepted if it
  1707. is valid and rejected if it is not. The account might be used
  1708. for charging purposes or it might be a secondary password, or it
  1709. might be used for any other purpose, such as an access password
  1710. for a particular disk. Servers that support accounts might or
  1711. might not allow or require the account to be sent prior to
  1712. login; usually it is sent after login, if at all. Synonym:
  1713. ACCOUNT.
  1714. Example:
  1715. set ftp autologin off ; One thing at a time please
  1716. ftp xyzcorp.com ; Try to make the connection
  1717. if fail exit 1 FTP connection failed ; Check that it was made
  1718. ftp user olga secret ; Now log in to the server
  1719. if fail exit 1 FTP login failed ; Check that it worked
  1720. ftp account 103896854 ; Login OK - send account
  1721. if fail echo WARNING - FTP ACCT failed ; Warn if problem
  1722. ... ; (have session here)
  1723. bye ; Log out and disconnect
  1724. The following commands are used to control or get information about the
  1725. FTP connection. Any particular FTP server does not necessarily support
  1726. all of them.
  1727. FTP RESET
  1728. Terminates a user session but leaves the connection open,
  1729. allowing a new login via FTP USER.
  1730. FTP IDLE [ number ]
  1731. Most FTP servers automatically log you out and and disconnect
  1732. your session if there has been no activity for a certain amount
  1733. of time. Use this command to ask the server to set its idle
  1734. limit to the given number of seconds. Omit the number to ask the
  1735. server to inform you of its current idle limit.
  1736. FTP STATUS [ filename ]
  1737. Asks the FTP server to send information about the current
  1738. session. The result is a free-format report that might include
  1739. server identification, username and login time, FTP protocol
  1740. settings, and file-transfer statistics. If a filename is given,
  1741. the server is supposed to send detailed information about the
  1742. file.
  1743. FTP SYSTEM
  1744. Asks the FTP server to identify its operating system (Listed in
  1745. Internet Assigned Numbers, Operating System Names). Examples:
  1746. UNIX, VMS, VM/CMS, WINDOWS-NT. Unfortunately many variations are
  1747. allowed (e.g. LINUX-2.0, LINUX-2.2, FREEBSD, ULTRIX, etc,
  1748. instead of UNIX; WINDOWS-NT-3, WINDOWS-NT-3.5, WINDOWS-NT-3.51,
  1749. WINDOWS-NT-4, etc). The report might also include other
  1750. information like "Type L8", "Type I", or "Type A", indicating
  1751. the file-transfer mode.
  1752. FTP HELP [ keyword [ keyword [ ... ] ]
  1753. Asks the server to list the commands it supports. The response
  1754. is usually cryptic, listing FTP command mnemonics, not the
  1755. commands used by the client (since the server has no way of
  1756. knowing anything about the client's user interface). For
  1757. example, the PUT command is STOR in FTP protocol. If a keyword
  1758. is given, which should be an FTP protocol command,
  1759. slightly-more- detailed help is given about the corresponding
  1760. command (if the FTP server supports this feature). Examples:
  1761. "ftp help", "ftp help stor".
  1762. FTP SITE text
  1763. (Advanced) Sends an FTP SITE (site-specific) command. Usually
  1764. this means that the FTP server is asked to run an external
  1765. command with the given arguments. You might be able to find out
  1766. what SITE commands are available by sending "ftp help site" to
  1767. the server, but in general the availability of and response to
  1768. SITE commands is (not surprisingly) site specific.
  1769. FTP QUOTE text
  1770. (Advanced) Sends an FTP command in FTP protocol format. Use this
  1771. command to send commands to the server that the FTP client might
  1772. not know about.
  1773. SHOW FTP
  1774. Lists client (Kermit) FTP settings and information. Also SHOW
  1775. CONNECTION, SHOW COMMUNICATIONS.
  1776. HELP FTP [ keyword ]
  1777. Asks Kermit to list and describe its built-in FTP commands.
  1778. HELP SET FTP [ keyword ]
  1779. Asks Kermit to list and describe its built-in SET FTP commands.
  1780. [ [240]Top ] [ [241]FTP Top ] [ [242]C-Kermit Home ] [ [243]Kermit Home
  1781. ]
  1782. 3.1.5. Making Proxy Connections
  1783. The simplist form of firewall traversal is the HTTP CONNECT command.
  1784. The CONNECT command was implemented to allow a public web server which
  1785. usually resides on the boundary between the public and private networks
  1786. to forward HTTP requests from clients on the private network to public
  1787. web sites. In order to allow secure web connections to be established,
  1788. the CONNECT command works by authenticating the client with a
  1789. username/password and then establishing a tunnel to the desired host.
  1790. Many web servers support the CONNECT command and it can be configured
  1791. to allow outgoing connections to authenticated user to any TCP/IP
  1792. hostname/port combination accessible to the web server. The limitations
  1793. of HTTP CONNECT is that it can only be used for outgoing connections
  1794. for protocols that are implemented using TCP/IP. Protocols such as
  1795. Kerberos authentication that use UDP/IP cannot be tunneled using HTTP
  1796. CONNECT.
  1797. Kermit provides support for the use of HTTP CONNECT proxy services with
  1798. the command:
  1799. SET TCP HTTP-PROXY [/USER:username /PASSWORD:password] hostname/ip-address[:po
  1800. rt]
  1801. When a port is not specified the default port configured on the HTTP
  1802. server is used. This is frequently port 443. When a hostname is
  1803. specified, it is resolved using the DNS available to the web server.
  1804. 3.2. Making Secure FTP Connections
  1805. Also see: [244]Accessing IBM Information Exchange with Kermit.
  1806. In the previous section, you can see several examples of traditional
  1807. insecure authentication: username and password sent across the network
  1808. in clear text. Of course this is bad practice on at least two counts:
  1809. (1) storing passwords in files (such as script files) gives access to
  1810. the target systems to anybody who can obtain read access to your
  1811. scripts; and (2) sending this information over the network leaves it
  1812. open to interception by network sniffers or compromised hosts.
  1813. Because of the increasing need for security on the Internet, FTP
  1814. servers are beginning to appear that offer secure forms of
  1815. authentication, in which no information is sent over the network that
  1816. would allow anyone who intercepts it to usurp your identity and gain
  1817. your access rights.
  1818. Kermit provides an equivalent form of FTP security for each type of
  1819. IETF standard security implemented in Telnet. These include
  1820. GSSAPI-KERBEROS5, KERBEROS4, Secure Remote Password (SRP), and
  1821. Transport Layer Security (SSL and TLS). It does not presently include
  1822. SSL tunneling nor any form of SSH v1 or v2. When Kermit is built with
  1823. the necessary libraries, secure FTP connections are attempted by
  1824. default, in which all connections are authenticated and the command and
  1825. data channels are private.
  1826. The use of authentication and encryption for FTP connections can be
  1827. adjusted with the commands listed below, which are available only if
  1828. your version of Kermit was built with the corresponding security
  1829. options and libraries:
  1830. SET FTP AUTHTYPE { AUTOMATIC, GSSAPI-KRB5, KERBEROS4, SRP, SSL, TLS }
  1831. Specifies an ordered list of authentication methods to be
  1832. attempted when AUTOAUTHENTICATION is ON. The default list is:
  1833. GSSAPI-KRB5, SRP, KERBEROS_V4, TLS, SSL. If none of the selected
  1834. methods are supported by the server, an insecure login is used
  1835. as a fallback. Note, by the way, that SSL or TLS can be used to
  1836. secure an anonymous connection.
  1837. SET FTP AUTOAUTHENTICATION { ON, OFF }
  1838. Tells whether authentication should be negotiated by the FTP
  1839. OPEN command. Default is ON. Use SET FTP AUTOAUTHENTICATION OFF
  1840. to force a clear-text, unencrypted connection to FTP servers
  1841. (such as the one at the Kermit FTP site) that normally would try
  1842. to negotiate secure authentication and encryption.
  1843. SET FTP AUTOENCRYPTION { ON, OFF }
  1844. Tells whether encryption (privacy) should be negotiated by the
  1845. FTP OPEN command, which can happen only if secure authentication
  1846. is also negotiated. Default is ON.
  1847. SET FTP AUTOLOGIN { ON, OFF }
  1848. Tells Kermit whether to try logging in automatically when you
  1849. make an FTP connection, as opposed to letting you do it "by
  1850. hand" with the FTP USER command.
  1851. SET FTP COMMAND-PROTECTION-LEVEL { CLEAR, CONFIDENTIAL, PRIVATE, SAFE }
  1852. Determines the level of protection applied to the command
  1853. channel:
  1854. CLEAR Data is sent in plaintext and not protected against tampering.
  1855. CONFIDENTIAL Data is encrypted but not protected against tampering.
  1856. PRIVATE Data is encrypted and is protected against tampering.
  1857. SAFE Data is sent in plaintext but protected against tampering.
  1858. The default is PRIVATE.
  1859. SET FTP CREDENTIAL-FORWARDING { ON, OFF }
  1860. Tells whether end-user credentials are to be forwarded to the
  1861. server if supported by the authentication method (GSSAPI-KRB5
  1862. only). This is often required to allow access to distributed
  1863. file systems (e.g. AFS.)
  1864. SET FTP DATA-PROTECTION-LEVEL { CLEAR, CONFIDENTIAL, PRIVATE, SAFE }
  1865. Tells what level of protection is applied to subsequent data
  1866. channels. The meanings of the protection-level keywords are the
  1867. same as for SET FTP COMMAND-PROTECTION-LEVEL. The default is
  1868. PRIVATE.
  1869. SET FTP SRP CIPHER name
  1870. Specifies the cipher to be used for encryption when SRP
  1871. authentication is in use. The list of possible choices is
  1872. computed based on the capabilities of the local SRP library and
  1873. includes NONE plus zero or more of the following:
  1874. BLOWFISH_ECB CAST5_ECB DES_ECB DES3_ECB
  1875. BLOWFISH_CBC CAST5_CBC DES_CBC DES3_CBC
  1876. BLOWFISH_CFB64 CAST5_CFB64 DES_CFB64 DES3_CFB64
  1877. BLOWFISH_OFB64 CAST5_OFB64 DES_OFB64 DES3_OFB64
  1878. The default is DES3_ECB.
  1879. SET FTP SRP HASH name
  1880. Specifies the hash to be used for data protection when SRP
  1881. authentication is in use. The choices are MD5 and SHA. The
  1882. default is SHA.
  1883. Command-line options:
  1884. -k name
  1885. Specifies the realm to be used with Kerberos 4 authentication (=
  1886. SET AUTH K4 REALM name).
  1887. -f
  1888. Enables forwarding of Kerberos 5 credentials to the host when
  1889. using GSSAPI authentication (= SET AUTH K5 FORWARDABLE ON).
  1890. -x
  1891. Enables autoencryption (= SET FTP AUTOENCRYPTION ON).
  1892. -c cipher
  1893. Specifies the kind of cipher to be used for encryption with SRP
  1894. authentication. Equivalent to SET FTP SRP CIPHER, with the same
  1895. choices. If this option is not given, CAST5_CBC is used.
  1896. -H hash
  1897. Specifies the hash to be used for encryption with SRP
  1898. authentication. Equivalent to SET FTP SRP HASH, with the same
  1899. choices. If this option is not given, SHA is used.
  1900. -z debug
  1901. Turns on SSL/TLS debugging.
  1902. -z secure
  1903. Requires secure connection.
  1904. -z certsok
  1905. Says to accept all certificates without checking validity.
  1906. -z verify=n
  1907. Sets certificate verification mode to the given number, n:
  1908. 0 = no verification
  1909. 1 = verify certificate if presented
  1910. 2 = require verification of certificate
  1911. -z cert=filename
  1912. Specifies a file containing a client certificate to be presented
  1913. to the FTP server.
  1914. -z key=filename
  1915. Specifies a file containing a private key matching the client
  1916. certificate.
  1917. -z !krb4
  1918. (nokrb4) Disables the use of Kerberos 4.
  1919. -z !gss
  1920. -z nogss
  1921. Disables the use of GSSAPI - Kerberos 5.
  1922. -z !srp
  1923. -z nosrp
  1924. Disables use of SRP.
  1925. -z !ssl
  1926. -z nossl
  1927. Disables the use of SSL.
  1928. -z !tls
  1929. -z notls
  1930. Disables the use of TLS.
  1931. Caution: If your FTP connection is secured via AUTH TLS, it is not
  1932. possible to interrupt a file transfer. This is a limitation of all
  1933. known FTP servers that support AUTH TLS.
  1934. Note that when using certain security methods, such as SSL or TLS, you
  1935. may be prompted to confirm or verify certain actions or conditions, for
  1936. example, whether to accept self-signed certificates. This can interfere
  1937. with unattended operation of scripts; see [245]Section 3.10.
  1938. [ [246]Top ] [ [247]FTP Top ] [ [248]C-Kermit Home ] [ [249]Kermit Home
  1939. ]
  1940. 3.3. Setting FTP Preferences
  1941. FTP preferences can be set globally and persistently with the commands
  1942. in the following sections; many of these can also be overridden on a
  1943. per-command basis with switches that have the same name.
  1944. 3.3.1. Logs, Messages, and Other Feedback
  1945. You can control the amount of feedback received from your FTP session
  1946. with the commands in this section. First, you can create a log of your
  1947. FTP transfers with the following commands:
  1948. SET TRANSACTION-LOG { VERBOSE, FTP, BRIEF }
  1949. Selects the log format. VERBOSE is the default, and is described
  1950. in [250]the manual. FTP chooses a WU-FTPD format, the same as is
  1951. used by the popular FTP server. BRIEF creates per-file records
  1952. in comma-separated-list format. For greater detail, see
  1953. [251]Section 4.17 of the [252]C-Kermit 7.0 Update Notes.
  1954. LOG TRANSACTIONS filename
  1955. Records FTP (or Kermit, or any other protocol) uploads and
  1956. downloads in the given file using the format selected by the
  1957. most recent SET TRANSACTION-LOG command, if any, or else the
  1958. default format.
  1959. FTP screen messages and displays are controlled by the following
  1960. commands:
  1961. SET TRANSFER DISPLAY { FULLSCREEN, CRT, SERIAL, BRIEF, NONE, OFF }
  1962. FTP transfers use Kermit's normal file-transfer display styles.
  1963. Use this command to choose the desired format; the default on
  1964. most platforms is FULLSCREEN. The display is automatically
  1965. disabled if Kermit is running in the background or in batch.
  1966. BRIEF is always used for command-line initiated transfers
  1967. (unless suppressed by -q). While a file-transfer is in progress,
  1968. you can interrupt it in the normal Kermit way by typing one of
  1969. the following keys or key combinations:
  1970. X - Cancel current file but go on to the next one (if any).
  1971. Z - Cancel the entire transfer. Ctrl-L or Ctrl-W - Refresh
  1972. the file-transfer display (if any).
  1973. SET FTP DISPLAY { FULLSCREEN, CRT, SERIAL, BRIEF, NONE, OFF }
  1974. Like SET TRANSFER DISPLAY, but applies only to FTP connections,
  1975. and does not affect Kermit- or other protocol file transfers.
  1976. SET QUIET { ON, OFF }
  1977. This command applies to Kermit in general, not just FTP. OFF by
  1978. default; when ON, it suppresses most messages from most commands
  1979. as well as the file-transfer display.
  1980. SET FTP PROGRESS-MESSAGES { ON, OFF }
  1981. Tells whether Kermit should print locally-generated feedback
  1982. messages for each non-file-transfer command. ON by default.
  1983. SET FTP VERBOSE-MODE { ON, OFF }
  1984. Tells whether to display all responses from the FTP server. OFF
  1985. by default. This shows all responses to all commands, except
  1986. when the file-transfer display is active, and unless you have
  1987. SET QUIET ON. When OFF, responses are shown only for commands
  1988. such as FTP PWD whose purpose is to display a response.
  1989. SET FTP DEBUG { ON, OFF }
  1990. Tells whether local client debugging information should be
  1991. displayed. OFF by default. When ON, the commands that are sent
  1992. to the server are shown, as well as its responses (even if
  1993. VERBOSE-MODE is OFF), plus additional informational messages are
  1994. printed regarding the progress of secure operations. Also, the
  1995. temporary file created by the [253]MGET command is not deleted
  1996. so you can see what's in it.
  1997. Set all of these to OFF when silent running is desired.
  1998. 3.3.2. Operational Preferences
  1999. FTP DISABLE new-protocol-feature-name
  2000. FTP ENABLE new-protocol-feature-name
  2001. Explained in [254]Section 3.11.
  2002. SET FTP AUTOLOGIN { ON, OFF }
  2003. If you give this command prior to opening an FTP connection, it
  2004. controls whether Kermit tries to log you in automatically as
  2005. part of the connection process. Normally ON, which means the
  2006. username and password are sent automatically (and prompted for
  2007. if they are not yet known). When OFF, FTP OPEN connects to the
  2008. server without logging in. OFF is equivalent to the -n
  2009. command-line option when using Kermit's FTP command-line
  2010. personality. See [255]Section 3.1.4 for usage.
  2011. SET FTP PASSIVE-MODE { ON, OFF }
  2012. ON by default, to avoid random TCP port assignment for data
  2013. connections, which can prevent FTP protocol from working through
  2014. firewalls and network address translators (for more on these
  2015. topics, see the [256]Kermit security reference. Set to OFF in
  2016. case the FTP server does not support passive mode, or in case
  2017. the client has problems with it (it has been observed, for
  2018. example, that when using passive mode, the SCO XENIX 2.3.4
  2019. TCP/IP stack hangs in the connect() call forever). Synonyms:
  2020. PASSIVE [ ON ], PASSIVE OFF, PASV [ ON ], PASV OFF.
  2021. SET FTP SEND-PORT-COMMANDS { ON, OFF }
  2022. This command determines whether the FTP client sends a new PORT
  2023. command to the server when accepting incoming data connections
  2024. (as when not using passive mode.) When PASSIVE-MODE is OFF and
  2025. SET SEND-PORT is OFF, the port that was originally specified is
  2026. reused. This is the default behavior for normal FTP clients but
  2027. it is not compatible with many firewalls.
  2028. SET FTP CHARACTER-SET-TRANSLATION { ON, OFF }
  2029. Whether to translate character sets when transferring files with
  2030. FTP (explained in [257]Section 3.7). OFF by default.
  2031. SET FTP SERVER-CHARACTER-SET name
  2032. Tells Kermit the character set used by the FTP server, UTF-8 by
  2033. default ([258]Section 3.7).
  2034. SET FTP SERVER-TIME-OFFSET delta-time
  2035. Tells Kermit to apply the given [259]delta time to file
  2036. timestamps provided by the server for its files; for use when
  2037. (for example) the server does not have its timezone set
  2038. correctly.
  2039. SET FTP ERROR-ACTION { PROCEED, QUIT }
  2040. When transferring a group of files with FTP, and an error occurs
  2041. with one of the files, Kermit normally goes on the next file.
  2042. Use SET FTP ERROR-ACTION to QUIT to make Kermit stop the
  2043. transfer immediately and fail if an error occurs with any single
  2044. file in the group. Example: you have given Kermit a list of
  2045. files to send, and one of the files can not be found, or read
  2046. permission is denied. Note that canceling a file by typing 'X'
  2047. during transfer is not considered an error (if you want to
  2048. cancel the entire transfer, type 'Z' or Ctrl-C).
  2049. SET FTP PERMISSIONS { AUTO, ON, OFF }
  2050. When uploading files with PUT or MPUT, this tells whether Kermit
  2051. should send each file's permissions. The default is OFF, which
  2052. means not to send permissions, in which case the uploaded file's
  2053. permissions are set by the FTP server according to its own
  2054. criteria. ON means to send them, AUTO means to send them only if
  2055. the client (Kermit) and server are on like platforms (e.g. both
  2056. UNIX). This command has no effect when downloading, since the
  2057. FTP protocol does not include a way for the server to inform the
  2058. client of a file's permissions. Also see [260]FTP PUT
  2059. /PERMISSIONS. Note that setting permissions after uploading is
  2060. likely to work (correctly or at all) only when the client and
  2061. server platforms are alike (e.g. both of them are some form of
  2062. UNIX). Also note that Windows files don't have permissions. Also
  2063. see [261]FTP CHMOD.
  2064. SET FTP DATES { ON, OFF }
  2065. When downloading files with GET or MGET, this tells whether
  2066. Kermit should try to set the received file's date from the
  2067. server's date. FTP DATES is ON by default. Note, however, that
  2068. FTP protocol does not allow date preservation when uploading. So
  2069. at best, SET FTP DATES ON can work only when downloading, and
  2070. then only when the server agrees to furnish file dates.
  2071. SET FTP FILENAMES { AUTO, CONVERTED, LITERAL }
  2072. When uploading (sending) files, this tells whether to convert
  2073. outbound filenames to "common form". This means allowing only
  2074. one period in a name, uppercasing any lowercase letters,
  2075. replacing spaces by underscores, etc. AUTOMATIC is the default,
  2076. meaning LITERAL when client and server are the same type of
  2077. system (e.g. UNIX) and CONVERTED otherwise. Special case: if the
  2078. setting is AUTOMATIC and the client is not UNIX and the server
  2079. identifies itself as UNIX, Kermit uses a less-strict form of
  2080. conversion, in which lowercase letters are not uppercased and
  2081. the filename can contain any number of periods, but spaces are
  2082. still converted to underscore. When receiving, conversion
  2083. generally means to change all-uppercase names to lowercase and
  2084. spaces to underscore.
  2085. SET FTP UNIQUE-SERVER-NAMES { ON, OFF }
  2086. Applies only to uploads. Tells the server to create new, unique
  2087. names for incoming files that have the same names as existing
  2088. files. OFF by default, in which case the server overwrites
  2089. existing files with new files of the same name. When ON, the
  2090. server uses its own built-in method for creating new names for
  2091. incoming files; for example, appending a period (.) and a number
  2092. to the name. CAUTION: Use this option only if you do not need to
  2093. refer to the file after it is uploaded, since FTP protocol
  2094. provides no mechanism for the client to find out what name was
  2095. assigned by the server.
  2096. SET FTP COLLISION { ... }
  2097. When downloading, what to do if an incoming file has the same
  2098. name as an existing file. Options are the same as for SET FILE
  2099. COLLISION. If this command is not given, Kermit's regular FILE
  2100. COLLISION setting is used. If this command is given, it
  2101. overrides the FILE COLLISION setting for FTP transfers only. See
  2102. [262]Section 3.6.2 for details.
  2103. SET FTP TYPE { TEXT, BINARY, TENEX }
  2104. Changes the default transfer mode. When sending (uploading)
  2105. files, this command has no effect unless you disable automatic
  2106. text/binary mode switching ([263]Section 4) with SET FILE SCAN
  2107. OFF or SET TRANSFER MODE MANUAL. When receiving (downloading)
  2108. files, this command establishes the transfer mode to be used
  2109. when a filename does not match any of Kermit's text or binary
  2110. filename patterns, unless you use SET FTP GET-FILETYPE-SWITCHING
  2111. or SET TRANSFER MODE MANUAL to disable automatic switching, in
  2112. which case, this command establishes the transfer mode for all
  2113. downloaded files. In all cases, however, the FTP TYPE can be
  2114. overridden in any GET or PUT command by including a /TEXT
  2115. (/ASCII), /BINARY, or /TENEX switch. The FTP TYPE is independent
  2116. of the Kermit FILE TYPE setting. TENEX is used for sending 8-bit
  2117. binary files to 36-bit platforms such as TOPS-10, TOPS-20, and
  2118. TENEX, and getting them back again. Synonym: ASCII = TEXT. Note:
  2119. there is also an FTP TYPE command, which does what SET FTP TYPE
  2120. does but also sends a TYPE command to the server immediately if
  2121. the given type is different from the current one.
  2122. If you want want specific FTP preference settings to be in effect for
  2123. all your Kermit FTP sessions, put the desired SET FTP commands in your
  2124. Kermit customization file (~/.mykermrc in UNIX, K95CUSTOM.INI in
  2125. Windows).
  2126. [ [264]Top ] [ [265]FTP Top ] [ [266]C-Kermit Home ] [ [267]Kermit Home
  2127. ]
  2128. 3.4. Managing Directories and Files
  2129. In Kermit, commands for directory and file management can refer to:
  2130. * The local computer
  2131. * A remote computer when you have a connection to a Kermit server or
  2132. IKSD.
  2133. * A remote computer when you have a connection to an FTP server.
  2134. (There can also be an HTTP connection, but the commands in this section
  2135. don't apply to HTTP connections.)
  2136. Thus in general, each such command comes in three forms:
  2137. 1. With no prefix in C-Kermit 8.0.200, it refers to the local computer
  2138. (CD, DIR, etc). In C-Kermit 8.0.201 and later, however, the "locus"
  2139. switches to automatically to the remote FTP server when you make an
  2140. FTP connection (see the SET LOCUS description [268]Section 7); thus
  2141. C-Kermit 8.0.201 acts almost exactly like a regular FTP client when
  2142. it has an FTP connection, yet still acts like itself on other kinds
  2143. of connections.
  2144. 2. With the REMOTE prefix, it is for a Kermit server (REMOTE CD,
  2145. REMOTE DIR).
  2146. 3. With the FTP prefix, it's for an FTP server (FTP CD, FTP DIR).
  2147. 4. Also see [269]Section 3.8, which explains "R-commands" and
  2148. "L-commands".
  2149. Kermit's FTP file and directory management commands are as follows.
  2150. When an R-command is included in the Synonyms list, be sure to read
  2151. [270]Section 3.8 about rules for use of R-commands.
  2152. FTP CD [ directory ]
  2153. Tells the FTP server to change its default (working) directory
  2154. to the one given, which usually must be expressed in the syntax
  2155. of the server platform (UNIX, VMS, etc). If the directory is not
  2156. specified, the result depends on the FTP server -- it might
  2157. complain that the command is illegal, or it might change to your
  2158. original login directory. Synonyms: FTP CWD (Change Wording
  2159. Directory); RCD.
  2160. FTP CDUP
  2161. Tells the FTP server to change its default (working) directory
  2162. to the parent directory of its current one (equivalent to
  2163. "cd .." in UNIX, or "cd [-]" in VMS). Synonyms: RCDUP, FTP UP.
  2164. FTP PWD
  2165. Asks the FTP server to report ("print") its current working
  2166. directory. Synonym: RPWD.
  2167. FTP MKDIR directory
  2168. Asks the FTP server to create the directory whose name is given.
  2169. In general, the name must be in the syntax of the server's file
  2170. system, and it must be either absolute (a full pathname) or
  2171. relative to the server's current (working) directory. This
  2172. command fails if the directory can't be created for any reason,
  2173. including that it exists already. Synonym: RMKDIR.
  2174. FTP RMDIR directory
  2175. Asks the FTP server to remove the directory whose name is given.
  2176. The rules are the same as for MKDIR, plus in most cases, the
  2177. server will not remove any directory unless it is empty.
  2178. Synonym: RRMDIR.
  2179. FTP DIRECTORY [ filespec ] [ redirectors ]
  2180. Tells the FTP server to send a directory listing of the
  2181. specified files. If no filespec is given, the server lists all
  2182. files in its current working directory. The results are in
  2183. whatever format the server chooses to send them. You can use
  2184. UNIX-like redirectors to send the listing to a file or a
  2185. pipeline, exactly as with the regular Kermit client/server
  2186. REMOTE DIRECTORY command ([271]Using C-Kermit, Chapter 11).
  2187. Synonym: RDIRECTORY. Examples:
  2188. ftp dir ; Show listing of all files on screen
  2189. ftp dir *.txt ; List *.txt files on screen
  2190. ftp dir *.txt > somefile ; Put listing in somefile
  2191. ftp dir *.txt >> somefile ; Append listing to somefile
  2192. ftp dir *.txt | sort > somefile ; Put sorted listing in somefile
  2193. ftp dir | more ; Runs list through "more"
  2194. ftp dir | sort | more ; Runs list through "sort" and "more"
  2195. FTP VDIRECTORY [ filespec ] [ redirectors ]
  2196. "Verbose" directory. This is an alternative FTP DIRECTORY
  2197. command primarily for use with DECSYSTEM-20 (TOPS-20) FTP
  2198. servers, which send only filenames when given a DIRECTORY
  2199. command; the VDIRECTORY command makes them also send file sizes,
  2200. dates, and attributes.
  2201. FTP CHECK filespec
  2202. Asks the FTP server whether the given file exists or, if the
  2203. filespec contains wildcards, if any files match, and this
  2204. command succeeds or fails accordingly.
  2205. FTP MODTIME filename
  2206. Asks the FTP server, via the not-yet-standard FTP MDTM command,
  2207. to send the modification date and time of the given file. The
  2208. response should be a numeric string in the format:
  2209. yyyymmddhhmmssxxxxx... where yyyy is the year, mm is the month,
  2210. dd is the day, hh is the hour (0-23), mm is the minute, ss is
  2211. the second, and xxx... is the optional fraction of the second (0
  2212. or more digits). The date and time is expressed in UTC (GMT,
  2213. Zulu, Zero-Meridian). The result is available programmatically
  2214. in the [272]\v(ftp_message) variable, and is understandable by
  2215. Kermit's date-time switches and functions. For example, suppose
  2216. we want to upload all local files that are newer than a
  2217. particular file on the server:
  2218. C-Kermit> ftp modtime signpost
  2219. C-Kermit> echo \v(ftp_message)
  2220. 20010807113542.014
  2221. C-Kermit> ftp mput /after:\v(ftp_message)GMT *
  2222. Note that we must append "GMT" to the date-time string to let
  2223. the /AFTER switch know the time is GMT rather than local.
  2224. FTP SIZE filename
  2225. Asks the FTP server to send the size (in bytes) of the given
  2226. file. The result might vary depending on whether the current FTP
  2227. TYPE is binary or text ("ascii"). For a reliable byte count, do
  2228. FTP TYPE BINARY first. The result is available programmatically
  2229. in the [273]\v(ftp_message) variable.
  2230. FTP CHMOD permissions filename
  2231. Tells the FTP server to set the permissions (protection) of the
  2232. given file to the ones given. The permissions and filename must
  2233. be given in whatever syntax is required by the server. Example
  2234. (for a UNIX-based FTP server):
  2235. ftp chmod 664 oofa.txt
  2236. Not all servers support this command. For non-UNIX-based
  2237. servers, you might need to use FTP QUOTE or FTP SITE and the
  2238. appropriate platform-specific FTP server command.
  2239. FTP UMASK [ number ]
  2240. This command is probably specific to UNIX-based servers; it sets
  2241. the UNIX "umask", which is the default permissions mask for new
  2242. (in this case, incoming) files. Crudely put, the UNIX umask is
  2243. an octal representation of a binary number in in which a 1 bit
  2244. stands for a permission bit that must be 0, and a 0 bit stands
  2245. for a permission bit that can be 0 or 1 depending on other
  2246. factors, such as the permissions of the parent directory.
  2247. Example: "umask 007" requires that new files are created without
  2248. read/write/execute world permission. If the number is not
  2249. specified, the server's current umask is reported.
  2250. FTP RENAME filename newname
  2251. Asks the FTP server to rename the file whose name is "filename"
  2252. to "newname". Works only for one file; can not be used with
  2253. wildcards. The server's interpretation of "newname" can vary (in
  2254. some cases it must be a filename, in others perhaps it can also
  2255. be a directory name, in which case if the filename denote a
  2256. regular file, the file might be moved to the given directory).
  2257. Some servers might allow files to be renamed ("moved") between
  2258. physical disks or partitions, others might not. Synonym:
  2259. RRENAME.
  2260. FTP DELETE [ switches ] filespec [ filespec [ ... ] ]
  2261. Tells the FTP server to delete the file or files listed. Each
  2262. file specification may, but need not, contain wildcard
  2263. characters to match multiple files. File specifications and
  2264. wildcard syntax must be those of the server. Any file
  2265. specifications that contain spaces must be enclosed in braces or
  2266. doublequotes. FTP DELETE switches are:
  2267. /ERROR-ACTION: /FILENAMES: /NOBACKUPFILES /QUIET
  2268. /EXCEPT: /LARGER-THAN: /NODOTFILES /NOPAGE
  2269. /PAGE /RECURSIVE /SMALLER-THAN:
  2270. When used with FTP DELETE, the /RECURSIVE switch deletes files
  2271. but not directories, and furthermore depends on the server
  2272. providing recursive file lists, which is not the normal
  2273. behavior. For further details, see the descriptions of these
  2274. switches in [274]Section 3.6. Synonyms: FTP MDELETE (Kermit
  2275. makes no distinction between DELETE and MDELETE); RDELETE.
  2276. FTP TYPE { TEXT, BINARY, TENEX }
  2277. Tells the FTP server to change its file-transfer type to the one
  2278. given, immediately. See [275]SET FTP TYPE for details.
  2279. [ [276]Top ] [ [277]FTP Top ] [ [278]C-Kermit Home ] [ [279]Kermit Home
  2280. ]
  2281. 3.5. Uploading Files With FTP
  2282. Uploading means sending files from the client (Kermit) to the FTP
  2283. server. The basic command for uploading files with FTP is PUT:
  2284. FTP PUT [ switches ] [ filespec [ as-name ] ]
  2285. Uploads (sends) the file or files that match the file
  2286. specification, which may include wildcards, to the server. If no
  2287. filespec is given, the names of files to send are taken from the
  2288. /LISTFILE: file, if any, otherwise from the SEND-LIST, if any.
  2289. Unless you go out of your way to prevent it, Kermit determines
  2290. the transfer mode (text or binary) for each file automatically,
  2291. and switches automatically on a per-file basis. If an as-name is
  2292. given, the file is sent under that name instead of its own (if
  2293. an as-name is given with a wildcard filespec, the result is a
  2294. bit more complicated, and is explained later in this section).
  2295. Unlike normal FTP clients, Kermit does not prompt you by default (or at
  2296. all) for each file; it just sends them, just as it does with Kermit
  2297. protocol. The filespec can be a literal filename or a Kermit pattern,
  2298. described in:
  2299. [280]http://www.columbia.edu/kermit/ckermit70.html#x4.9
  2300. Kermit patterns are equivalent to C-Shell patterns and provide a fair
  2301. amount of flexibility in selecting which files to send, which is
  2302. augmented by the file-selection switches presented in [281]Section
  2303. 3.5.1.
  2304. FTP MPUT [ switches ] filespec [ filespec [ ... ] ]
  2305. FTP MPUT is just like FTP PUT except it allows you to give more
  2306. than one file specification, and it does not allow an as-name in
  2307. the file list. However, as-names can be given to either PUT or
  2308. MPUT with the /AS-NAME: switch.
  2309. If a PUT or MPUT command results in one file being uploaded, it
  2310. succeeds if the file is uploaded completely and fails otherwise. If
  2311. more than one file is selected for upload, success or failure depends
  2312. on the [282]FTP ERROR-ACTION setting; if it is PROCEED (the default
  2313. setting), then the [M]PUT command succeeds if at least one of the files
  2314. was completely uploaded, and fails otherwise, If FTP ERROR-ACTION is
  2315. QUIT, the [M]PUT command succeeds if all selected files were uploaded
  2316. successfully, and fails if any file failed.
  2317. FTP uploads may be interrupted just like Kermit uploads. While the
  2318. transfer is in progress, type:
  2319. X to interrupt the current file and go on to the next file.
  2320. Z to cancel the current file and all remaining files.
  2321. ^C (Control-C): Like Z, but might act more quickly.
  2322. MPUT may be used as in regular FTP clients, but it is not required to
  2323. send multiple files; in Kermit it is required only if you want to give
  2324. multiple file specifications. Examples:
  2325. ftp put oofa.txt ; Send a single file oofa.txt
  2326. ftp put oofa.txt budget.txt ; Send single file oofa.txt as budget.txt
  2327. ftp put *.txt ; Send all *.txt files
  2328. ftp mput *.txt ; Send all *.txt files (same as "put *.txt")
  2329. ftp mput *.txt foo.bar ; Send all *.txt files plus foo.bar
  2330. The distinction between PUT and MPUT is important only when more than
  2331. one filespec is given, just like the distinction between Kermit SEND
  2332. and MSEND:
  2333. ftp put oofa.txt budget.txt ; Send oofa.txt AS budget.txt
  2334. ftp mput oofa.txt budget.txt ; Send oofa.txt AND budget.txt
  2335. If the source file specification includes any path segments, for
  2336. example:
  2337. put /tmp/oofa.txt
  2338. put subdir/another/andanother/oofa.txt
  2339. the path portion is stripped from the filename that is sent to the
  2340. server. However, if an as-name contains a path, it is retained.
  2341. Examples:
  2342. ftp put /usr/doc/oofa.txt ; Send as "oofa.txt".
  2343. ftp put oofa.txt /tmp/oofa.txt ; Send as "/tmp/oofa.txt"
  2344. The latter example sends the file oofa.txt from your current local
  2345. directory to the server's /tmp directory. This works only if the server
  2346. uses the same directory notation that you used in the as-name AND the
  2347. given directory already exists on the server AND if you have write
  2348. access to it.
  2349. Use caution when uploading from a case-sensitive file system, such as
  2350. UNIX, to a file system that is not case sensitive, such as Windows or
  2351. VMS. If you have two files in UNIX, AA and aa and upload both of them,
  2352. the second one will overwrite the first. The only way around this
  2353. provided by FTP protocol is its "unique server names" feature (SET FTP
  2354. UNIQUE-SERVER-NAMES or the /UNIQUE switch described below).
  2355. 3.5.1. FTP PUT Switches
  2356. FTP PUT and MPUT are similar in format and behavior to the regular
  2357. Kermit SEND and MSEND commands, and they allow most of the same
  2358. optional switches:
  2359. C-Kermit>ftp put ? Filename, or switch, one of the following:
  2360. /after: /larger-than: /rename-to:
  2361. /array: /listfile: /server-character-set:
  2362. /as-name: /local-character-set: /server-rename-to:
  2363. /before: /move-to: /simulate
  2364. /binary /nobackupfiles /smaller-than:
  2365. /command /nodotfiles /tenex
  2366. /delete /nofollowlinks /text
  2367. /dotfiles /not-after: /transparent
  2368. /error-action: /not-before: /type:
  2369. /except: /permissions: /update
  2370. /filenames: /quiet /unique-server-names
  2371. /filter: /recover
  2372. /followlinks /recursive
  2373. Since most of these switches are common to Kermit's SEND and MSEND
  2374. commands, they described only briefly here. For greater detail see:
  2375. [283]http://www.columbia.edu/kermit/ckermit70.html#x1.5 (explanation
  2376. of switches)
  2377. [284]http://www.columbia.edu/kermit/ckermit70.html#x4.7
  2378. (file-transfer switches)
  2379. First the file-selection switches:
  2380. /AFTER:date-time
  2381. /BEFORE:date-time
  2382. /NOT-AFTER:date-time
  2383. /NOT-BEFORE:date-time
  2384. Only send those files modified on or after or before the given
  2385. date and time. These switches can be combined to select files
  2386. modified between two date/times. Various date-time formats are
  2387. accepted; if the date-time contains spaces, it must be enclosed
  2388. in braces or doublequotes. See
  2389. [285]http://www.columbia.edu/kermit/ckermit70.html#x1.6 and
  2390. [286]Section 8.13 of this document for details about date-time
  2391. formats. Examples:
  2392. ftp put /after:{1 jan 2000 0:00:00} *
  2393. ftp put /after:-5days *
  2394. /LARGER-THAN:number
  2395. /SMALLER-THAN:number
  2396. Only send files larger (smaller) than the given number of bytes
  2397. (octets). These switches can be combined to select files in a
  2398. certain size range.
  2399. /TYPE:{TEXT,BINARY}
  2400. Only send files that are the given type, which is determined for
  2401. each file just before sending it by file scanning. BINARY
  2402. includes TENEX; if you have included a /TENEX switch, or
  2403. previously given a [SET] FTP TYPE TENEX command, binary files
  2404. are sent in TENEX, rather than BINARY mode.
  2405. /[NO]DOTFILES
  2406. [Don't] include files whose names begin with dot (.). By
  2407. default, such files are not included unless your filespec
  2408. explicitly mentions them.
  2409. /NOBACKUPFILES
  2410. Don't include files whose names end with .~nnn~, where nnn is a
  2411. number, e.g. oofa.txt.~27~. These are backup files created by
  2412. Kermit, EMACS, and other applications. By default, backup files
  2413. are included.
  2414. /NOFOLLOWLINKS
  2415. (UNIX only) Skip over symbolic links rather than following them
  2416. (default). This applies to wildcard and/or recursive [M]PUTs; if
  2417. a single filename is given, and it happens to be a symbolic
  2418. link, the file it points to is sent.
  2419. /FOLLOWLINKS
  2420. (UNIX only) Always follow (resolve) symbolic links, even in
  2421. wildcard or recursive [M]PUTs. Use with caution. Watch out for
  2422. circular links, endless loops, etc.
  2423. /EXCEPT:pattern
  2424. Exception list -- don't send files whose names match the given
  2425. pattern. See [287]Section 1.5.4 of the [288]C-Kermit 7.0 Update
  2426. Notes for details. If you want to exclude a directory from a
  2427. recursive [M]PUT, use /EXCEPT:{dirname/*}.
  2428. /RECURSIVE
  2429. Sends the desired files from the current (or given) directory,
  2430. plus all directories beneath it, including empty directories,
  2431. replicating the directory structure on the server. No special
  2432. capabilities are required in the server, but of course your
  2433. login ID on the server must have the appropriate access and
  2434. permission to create directories. Recursive PUTs work not only
  2435. between like platforms (e.g. UNIX to UNIX) but also between
  2436. unlike ones (e.g. UNIX to VMS or Windows), in which case
  2437. text-file format differences are handled by Kermit's automatic
  2438. text/binary mode switching ([289]Section 4) and character-set
  2439. translation ([290]Section 3.7). Synonym: /SUBDIRECTORIES.
  2440. /UPDATE
  2441. Send only files that have changed since last time ([291]Section
  2442. 3.5.2).
  2443. /ARRAY:arrayname
  2444. The "file" to be sent is an array, or a segment of one, rather
  2445. than a real file. In this case the other selection switches
  2446. don't apply. The array contents are sent in text mode, and each
  2447. array element is treated as a line. Example:
  2448. ftp put /as-name:array.txt /array:&a
  2449. (or, to send a segment of the array, /array:&a[100:199]). If you
  2450. don't include an /AS-NAME, a name of "_array_x_" is used (where
  2451. x is the array letter). If you include this switch, most other
  2452. switches are meaningless and ignored.
  2453. /COMMAND
  2454. The "file" to be sent is the standard output of a command,
  2455. rather than a real file. It is sent in text or binary mode
  2456. according to the prevailing FTP TYPE, which can be overridden
  2457. with a /TEXT or /BINARY switch. Example: Example:
  2458. ftp put /command /as-name:{userlist} {finger | sort -r}
  2459. /LISTFILE:filename
  2460. Tells Kermit to obtain the list of files to be sent from the
  2461. file whose name is given. This file must contain one file
  2462. specification (which may be wild) per line. If the list includes
  2463. files from different directories, such as a recursive listing of
  2464. a directory tree, the paths are recreated on the server (if
  2465. possible) if you include the /RECURSIVE switch; otherwise all
  2466. the files are sent to the current directory on the server.
  2467. Now the other switches:
  2468. /AS-NAME:text
  2469. If a single file is being sent, send it with the given text as
  2470. its name. If multiple files are being sent, the text must be a
  2471. template that includes variables such as \v(filename),
  2472. \v(filenumber), \v(ntime), to allow dynamic creation of each
  2473. name. The same applies to the as-name field of the FTP PUT
  2474. command. If this switch is not included (and an as-name is not
  2475. included as the second filename to PUT), each file is sent with
  2476. its own name.
  2477. /BINARY
  2478. /TEXT
  2479. /TENEX
  2480. Forces this upload to take place in the given mode, regardless
  2481. of the current FTP TYPE setting, and without automatic
  2482. text/binary switching. /ASCII is a synonym for /TEXT.
  2483. /FILTER:command
  2484. Specifies that the file(s) is/are to be passed through the given
  2485. command or pipeline on their way to the server. Example:
  2486. ftp put /binary /filter:{gzip -c \v(filename)} /as-name:\v(filename).gz *
  2487. /TRANSPARENT
  2488. /LOCAL-CHARACTER-SET:name
  2489. /SERVER-CHARACTER-SET:name
  2490. Character-set translation for text files, explained in
  2491. [292]Section 3.7.
  2492. /ERROR-ACTION:{PROCEED,QUIT}
  2493. Overrides the prevailing [293]FTP ERROR-ACTION for the duration
  2494. of this PUT or MPUT command only.
  2495. /RECOVER
  2496. Resume an interrupted transfer where from the point of
  2497. interruption (explained in [294]Section 3.5.2). Synonym:
  2498. /RESTART.
  2499. /DELETE
  2500. Tells Kermit to delete each source file immediately after, and
  2501. only if, it has been uploaded completely and successfully. This,
  2502. in effect, moves the file from the client to the server.
  2503. /MOVE-TO:directory
  2504. Tells Kermit to move each source file to the named local
  2505. directory after, and only if, it has been uploaded completely
  2506. and successfully.
  2507. /RENAME-TO:template
  2508. Tells Kermit to rename each (local) source file according to the
  2509. given template after, and only if, it has been uploaded
  2510. completely and successfully. The template works as in /AS-NAME.
  2511. /SERVER-RENAME-TO:template
  2512. Tells Kermit to ask the server to rename each file according to
  2513. the given template as soon as, and only if, it has been received
  2514. completely and successfully. The template works as in /AS-NAME.
  2515. Requires write and rename access on the server, so doesn't
  2516. usually work with (e.g.) anonymous uploads to public incoming
  2517. areas where the permissions don't allow renaming. Examples:
  2518. ftp mput /server-rename:\v(filename).ok *
  2519. Appends ".ok" to each filename on the server when it's
  2520. finished uploading.
  2521. ftp mput /as-name:\v(filename).tmp /server-rename:\v(filename) *
  2522. This is the reverse of the previous example; it uses a
  2523. temporary name while uploading is in progress and reverts
  2524. the file to its real name when uploading is complete.
  2525. ftp mput /as-name:\v(filename)
  2526. /server-rename:../final/\v(filename) *
  2527. Moves the file from the working directory to a final
  2528. directory when the upload is complete, but in this case
  2529. you have to know the pathname syntax of the server. If the
  2530. rename fails, the [M]PUT command fails according to the
  2531. [295]FTP ERROR-ACTION selection.
  2532. /FILENAMES:{AUTOMATIC,CONVERTED,LITERAL}
  2533. Overrides the [296]FTP FILENAMES setting for this upload only.
  2534. /PERMISSIONS:{ON,OFF}
  2535. Overrides the [297]FTP PERMISSIONS setting for this upload only.
  2536. /UNIQUE
  2537. Tells Kermit to tell the server to give [298]unique names to
  2538. incoming files that would otherwise overwrite existing files
  2539. that have the same name. This switch conflicts with /UPDATE,
  2540. /RECOVER, /PERMISSIONS, and /SERVER-RENAME since the client has
  2541. no way of knowing the name assigned by the server.
  2542. /QUIET
  2543. Don't display file-transfer progress or statistics.
  2544. /SIMULATE
  2545. Shows which files would be sent without actually sending them.
  2546. Useful (for example) with /UPDATE (next section). The results
  2547. are shown in the file-transfer display (if it is not disabled)
  2548. and in the transaction log (if one is active). Hint: use SET
  2549. TRANSFER DISPLAY BRIEF.
  2550. 3.5.2. Update Mode
  2551. When you include the /UPDATE switch, this means to skip sending any
  2552. file that already exists on the server if the local file's modification
  2553. date/time is not later than that of the corresponding file on the
  2554. server. Here is a typical application for update mode: Suppose that on
  2555. Computer A, you maintain a large set of files (say, a collection of Web
  2556. pages and graphics images, or the source files for a software
  2557. application), and you need to keep a parallel copy on another Computer,
  2558. B. Of course you could upload the entire collection every day:
  2559. cd source-directory
  2560. ftp computerb.xyzcorp.com
  2561. ( authentication details... )
  2562. ftp cd target-directory
  2563. ftp put [ switches ] *
  2564. But if the total size is large or the network slow, this would be
  2565. unnecessarily time-consuming. Worse, if other users or sites had to
  2566. update whenever new files appeared in B's directory, this would cause
  2567. them unnecessary work. By including the /UPDATE switch:
  2568. ftp put /update [ other-switches ] *
  2569. only those files that changed since last time are uploaded. Here's how
  2570. it works. For each local file that is selected for uploading:
  2571. * The remote filename is determined in the normal way, according to
  2572. the [299]FTP FILENAMES setting, /FILENAMES switch, or the as-name,
  2573. if any.
  2574. * Kermit sends an MDTM (modification time) command for the
  2575. corresponding remote filename to the server.
  2576. * If the server does not understand the MDTM command, the file is
  2577. sent.
  2578. * If the server can't find a file with the given name, the file is
  2579. sent.
  2580. * If the local file's modification time is later than that of the
  2581. remote file, the file is sent.
  2582. * Otherwise -- the remote file exists but its modification time is
  2583. equal to or earlier than that of the local file -- the file is
  2584. skipped.
  2585. All time comparisons take place in Coordinated Universal Time
  2586. (UTC)([300]1), also known as GMT or Zulu time: Timezone 0; standard
  2587. time, without daylight savings.
  2588. WARNING: Some FTP servers, such as Novell NWFTPD.NLM, ignore or
  2589. misimplement the FTP specification and send local time rather than
  2590. UTC.
  2591. Update mode is useful only when always used in the same direction. When
  2592. you upload (PUT) a file with FTP, the destination file receives the
  2593. current timestamp on the server's computer, not the original file's
  2594. timestamp ([301]2). If you try to FTP PUT /UPDATE the same file again,
  2595. it will be skipped (as expected) since the remote copy is newer.
  2596. However, if you try to FTP GET /UPDATE the same file ([302]Section
  2597. 3.6), it will be transferred for the same reason.
  2598. To check the availability of PUT /UPDATE on a particular connection,
  2599. issue an FTP MODTIME command for a file that is known to exist on the
  2600. server. If it succeeds, PUT /UPDATE should work and in that case, you
  2601. can run a procedure like the one above every day: the first time, it
  2602. sends all the files; after that, it sends only the ones that changed.
  2603. If a transaction log is active, a notation is included for any files
  2604. that are skipped.
  2605. Notes:
  2606. 1. Why is Coordinated Universal Time abbreviated UTC? From the
  2607. [303]National Institute of Standards and Technology FAQ: "In 1970
  2608. the Coordinated Universal Time system was devised by an
  2609. international advisory group of technical experts within the
  2610. International Telecommunication Union (ITU). The ITU felt it was
  2611. best to designate a single abbreviation for use in all languages in
  2612. order to minimize confusion. Since unanimous agreement could not be
  2613. achieved on using either the English word order, CUT, or the French
  2614. word order, TUC, the acronym UTC was chosen as a compromise."
  2615. 2. The Kermit FTP client is unusual in that, when downloading only, it
  2616. can set the received file's date from the file's date on the
  2617. server, but this should not affect the update feature. When
  2618. uploading to an FTP server, however, there is no mechanism for the
  2619. client to set the date of the uploaded file on the server.
  2620. 3.5.3 Recovery
  2621. Suppose that while you are uploading a large file over a slow
  2622. connection, the connection is lost before the entire file is
  2623. transferred. With most FTP clients, you would have to start over, thus
  2624. resending the portion of the file that was sent already, and that is
  2625. already on the server. But Kermit's /RECOVER switch (Synonym: /RESTART)
  2626. lets you continue an interrupted transfer from the point of failure,
  2627. thus transferring only the part that wasn't sent already. The
  2628. prerequisites for recovery are:
  2629. * The transfer must be in BINARY mode, or else the client and server
  2630. must reside on like systems (e.g. both on some form of UNIX).
  2631. * The FTP server must support the SIZE command.
  2632. Here's how it works. When you include the /RECOVER switch:
  2633. * Kermit checks for conflicting switches, such as /UPDATE and
  2634. /UNIQUE; if /RECOVER is given with these switches an error occurs.
  2635. If /RECOVER is given in other circumstances where it could serve no
  2636. useful purpose (e.g. with arrays, pipes, or filters), it is
  2637. ignored.
  2638. If the switch is accepted, then for each selected file:
  2639. * If it is not binary (determined by scanning) and the client and
  2640. server are not on like platforms, recovery is canceled (the entire
  2641. file is sent). Otherwise:
  2642. * A SIZE command is sent for the file (using its remote name). If the
  2643. reply indicates the file was not found, or the SIZE command was not
  2644. understood, or any other kind of error, recovery is canceled.
  2645. Otherwise:
  2646. * A MDTM (modification time) command is sent for the file. If a valid
  2647. reply is received, and the modification time of the local file is
  2648. later than that of the remote file, recovery is canceled.
  2649. Otherwise:
  2650. * If the sizes of the two files are identical, the file is not sent.
  2651. Otherwise:
  2652. * Kermit seeks to the recovery spot in the local file, tells the
  2653. server to APPEND the data which is about to arrive to the remote
  2654. file, and then sends the data starting at the recovery point.
  2655. To safeguard file integrity, recovery is not attempted unless all the
  2656. preconditions are met. For the widest possible usefulness, APPEND is
  2657. used rather than RESTART. For stream transfers (the only kind that
  2658. Kermit supports) the results are the same.
  2659. By design, the /RECOVER switch can be included with any FTP PUT or MPUT
  2660. command, even if it specifies a group of files. This allows you to
  2661. resume an interrupted batch transfer from where it left off. The files
  2662. that were already completely sent are skipped, the file that was
  2663. interrupted is recovered, and the remaining files are uploaded.
  2664. By the way, it doesn't matter how the original partial file was
  2665. uploaded -- FTP, Kermit, Zmodem, etc: as long as the preconditions are
  2666. met, it can be recovered with FTP PUT /RECOVER, or for that matter also
  2667. using Kermit protocol and SEND /RECOVER.
  2668. A word of caution, however, when the original upload was in text mode
  2669. with character-set translation ([304]Section 3.7):
  2670. * If the original upload involved a translation from one single-byte
  2671. character set to another (e.g. Code Page 850 to Latin-1), recovery
  2672. is safe if you specify the same translations for the recovery. If
  2673. you don't, the resulting file will contain a mixture of character
  2674. sets.
  2675. * If the original upload involved a translation that changed the size
  2676. of the file (e.g. from an alphabetic Code Page or Latin Alphabet to
  2677. Unicode, or vice versa), recovery is NOT safe, even if you specify
  2678. the same translations.
  2679. Kermit has no way of knowing anything about the previous upload. As a
  2680. safeguard, an error occurs if you include /RECOVER and also specify a
  2681. character-set of UCS2 or UTF8, since recovery can't possibly work in
  2682. that situation. Otherwise, it's up to you to avoid unsafe recovery
  2683. operations.
  2684. [ [305]Top ] [ [306]FTP Top ] [ [307]C-Kermit Home ] [ [308]Kermit Home
  2685. ]
  2686. 3.6. Downloading Files With FTP
  2687. Although uploading files with Kermit's FTP client is just as easy and
  2688. flexible as sending files with Kermit protocol, the same is not always
  2689. true for downloading because FTP servers lack some of the capabilities
  2690. of a Kermit server:
  2691. * If you want to get more than one file, you have to use MGET, not
  2692. GET, since the underlying FTP protocol is different in the two
  2693. cases. Kermit can't "autodetect" which one you mean, as it can with
  2694. PUT and MPUT, since it can't be expected to know the wildcard
  2695. syntax of the remote platform and/or FTP server (the same is true
  2696. for all other FTP clients). To complicate matters, FTP protocol now
  2697. includes two underlying mechanisms (NLST and MLSD) for
  2698. accomplishing MGET operations and, as explained in [309]Section
  2699. 3.11, the two behave differently.
  2700. * Automatic text-binary mode switching is not done by the server. It
  2701. can be done by the client (Kermit), but in this case it is not
  2702. based on a file scan (since there is no way for Kermit prescan a
  2703. server file), but rather on the filename, using C-Kermit 7.0
  2704. [310]filename patterns.
  2705. * Some options that are available with FTP PUT can not be used with
  2706. FTP [M]GET or don't work the same way:
  2707. /PERMISSIONS (FTP protocol has no mechanism for this).
  2708. /[NOT-]BEFORE, /[NOT-]AFTER (because of the timezone problem).
  2709. /RECOVER works only in binary mode. /RECURSIVE has limited
  2710. utility.
  2711. The commands for downloading are:
  2712. SET FILE DOWNLOAD-DIRECTORY [ directory ]
  2713. As with Kermit transfers, this command, if given, tells C-Kermit
  2714. where to store incoming files in the absence of a specific
  2715. as-name. If not given, incoming files are stored as indicated by
  2716. the as-name, if any, otherwise in the current directory, just as
  2717. with Kermit transfers. The more verbose transfer display formats
  2718. give the full pathname of each received file, and, in case you
  2719. have trouble finding a downloaded file afterwards, its full path
  2720. is also listed in the transaction log (if you kept one), and you
  2721. can also ask Kermit where it went with the [311]WHERE command.
  2722. SET FTP GET-FILETYPE-SWITCHING { ON, OFF }
  2723. ON by default, causing Kermit to switch automatically into text
  2724. or binary mode for each file based on whether its name matches a
  2725. text pattern or binary pattern. Set this OFF, or use a /TEXT,
  2726. /BINARY, or /TENEX switch to defeat this feature. Use SHOW
  2727. PATTERNS to see the current pattern list.
  2728. [ FTP ] GET [ switches ] filename [ as-name ]
  2729. Asks the server to send the given file, and if it comes, stores
  2730. it locally under the given as-name, if any, otherwise under its
  2731. original name (modified according to the selected filename
  2732. conversion option), in your download directory, if you have
  2733. specified one, otherwise in the directory indicated in the
  2734. as-name, if any, otherwise in your current directory. If you
  2735. accidentally use a wildcard in the filename ("get *.txt") the
  2736. server will reply with a message like "File not found" (unless
  2737. there is a file whose name actually is "*.txt"). If FTP
  2738. GET-FILETYPE-SWITCHING is ON, and in the absence of any GET
  2739. switches to override it, the file is transferred in binary mode
  2740. if it matches any of Kermit's binary name patterns, and in text
  2741. mode if it matches any of Kermit's text name patterns, and in
  2742. the prevailing FTP TYPE if it matches none of these patterns.
  2743. [ FTP ] MGET [ switches ] filespec [ filespec [ filespec [ ... ] ] ]
  2744. Like GET, but for multiple files. One or more file
  2745. specifications can be given, and any or all (or none) of them
  2746. can contain wildcards or can be directory names. The file list
  2747. may not include an as-name, but you can still give one with the
  2748. /AS-NAME: switch.
  2749. In both the FTP GET and MGET commands, any filenames that contain
  2750. spaces must be enclosed in braces or doublequotes (see [312]Section 5
  2751. for details).
  2752. FTP downloads may be interrupted just like Kermit transfers. While the
  2753. transfer is in progress, type:
  2754. * X to interrupt the current file and go on to the next file.
  2755. * Z (or Control-C) to cancel the current file and all remaining
  2756. files.
  2757. Before proceeding, a brief word about temporary files. In FTP protocol,
  2758. the MGET command works by requesting a file list from the server, and
  2759. then (internally) issuing a GET command (FTP RETR protocol directive)
  2760. for each file. The file list returned by the server can be any size at
  2761. all, so in case it is huge, we don't store it in memory; instead we put
  2762. it in a temporary file. For troubleshooting purposes, you should be
  2763. aware of two points:
  2764. 1. The location of the temporary file is chosen according the TMP or
  2765. TEMP environment variables. If neither of these variables is
  2766. defined, you might need to define it. In case there is not enough
  2767. space on the indicated disk or partition for the server's file
  2768. list, you might need to either clean up the temporary area, or
  2769. redefine the environment variable to indicate a different area that
  2770. has sufficient space.
  2771. 2. If you want to look at the list yourself, use SET FTP DEBUG ON.
  2772. This tells Kermit to (a) give you the full pathname of the
  2773. temporary file at the end of each MGET command, and (b) not to
  2774. delete it, as it normally does.
  2775. 3.6.1. FTP GET Switches
  2776. The following switches are available with FTP GET and MGET:
  2777. /TEXT
  2778. Specifies a text-mode transfer. Overrides the global FTP TYPE
  2779. setting and filename pattern-matching for the duration of the
  2780. current command only, All files are downloaded in text mode.
  2781. Synonym: /ASCII.
  2782. /BINARY
  2783. Specifies a binary-mode transfer. Overrides the global FTP TYPE
  2784. setting and filename pattern-matching for the duration of the
  2785. current command only. All files are downloaded in binary mode.
  2786. /TENEX
  2787. Like /BINARY but specifies a special binary transfer mode to be
  2788. used when getting 8-bit binary files from a 36-bit platform such
  2789. as TOPS-10, TOPS-20, or TENEX. All files are downloaded in the
  2790. special binary mode.
  2791. /RECOVER
  2792. This instructs Kermit to try to recover an incomplete download
  2793. from the point of failure. Works only in binary mode, and only
  2794. if the server supports the (not-yet-standard) FTP "REST"
  2795. directive. See [313]Section 3.6.3 for details. Synonym:
  2796. /RESTART.
  2797. /FILENAMES:{CONVERTED,LITERAL}
  2798. Overrides the [314]FTP FILENAMES (filename conversion) setting
  2799. for this download only, forcing incoming filenames to be either
  2800. converted or taken literally.
  2801. /AS-NAME:text
  2802. For GET, this is equivalent to giving an as-name after the
  2803. filename. For MGET, this is the only way to specify alternative
  2804. names for the incoming files. With MGET, the /AS-NAME text
  2805. should (must) contain a Kermit variable, usually \v(filename) or
  2806. \v(filenumber). Example:
  2807. mget /text /as-name:\v(filename).new *.c
  2808. This gets all ".c" files and stores them with "
  2809. .new" appended to their names. See the [315]C-Kermit 7.0 Update
  2810. Notes for details.
  2811. /COMMAND
  2812. This specifies that the incoming file is to be written to the
  2813. standard input of a command, rather than to a file. The command
  2814. name is the as-name from the GET command or the /AS-NAME
  2815. argument. If you need to refer to the incoming file's name in
  2816. the command, use \v(filename). See the description of the
  2817. regular Kermit [316]GET /COMMAND command for details and
  2818. examples.
  2819. /QUIET
  2820. Transfers the files quietly; don't put up a file-transfer
  2821. display.
  2822. /ERROR-ACTION:{QUIT,PROCEED}
  2823. This switch affects only MGET. If an error occurs with a
  2824. particular file, this tells whether to go on to the next file
  2825. (PROCEED) or to stop right away and fail (QUIT). The default is
  2826. PROCEED.
  2827. The file selection switches are:
  2828. /EXCEPT:{pattern} or /EXCEPT:{{pattern}{pattern}{...}}
  2829. Exception list for MGET; skip downloading any file whose name
  2830. matches any of the given patterns (when using the second format,
  2831. up to 64 patterns may be specified).
  2832. /SMALLER-THAN:number
  2833. Download only files whose size is smaller than the given number
  2834. of bytes (octets). Requires that the FTP server support the SIZE
  2835. or MLSD directive.
  2836. /LARGER-THAN:number
  2837. Download only files whose size is greater than the given number
  2838. of bytes. Requires that the FTP server support the SIZE or MLSD
  2839. directive.
  2840. /NOBACKUPFILES
  2841. During MGET, don't download any files whose names end with
  2842. backup suffixes (.~n~ where n is a number).
  2843. /NODOTFILES
  2844. During MGET, don't download any files whose names begin with
  2845. period (.). Equivalent to /EXCEPT:{.*}.
  2846. /LISTFILE:local-filename
  2847. The given file contains a list of files to GET, one per line.
  2848. Filenames in the listfile can contain wildcard characters in the
  2849. syntax of the server. There is no limit on the number of lines
  2850. in the listfile.
  2851. /NAMELIST:local-filename
  2852. If this switch is given, then instead of actually retrieving the
  2853. selected files, the GET command retrieves a list of the names of
  2854. the files that would be retrieved, and places it in the
  2855. specified file. The resulting file is an ordinary text file,
  2856. with one filename per line, suitable for reading by a person, or
  2857. processing by a computer program, including Kermit itself (FOPEN
  2858. / FREAD / FWRITE / FCLOSE), and as /FILELIST: file. If the
  2859. filename is omitted or given as "-" (dash, hyphen), the list
  2860. goes to the screen. NOTE: if you want a copy of the complete
  2861. list sent by the server, use SET FTP DEBUG ON, perform an MGET,
  2862. and the temporary file containing the list will be kept rather
  2863. than deleted (and Kermit tells you its name).
  2864. /UPDATE, /COLLISION:keyword
  2865. Explained in [318]Section 3.6.2.
  2866. /RECURSIVE
  2867. This means to try to download an entire directory tree, rather
  2868. than just files from a particular directory. In fact, FTP
  2869. protocol does not provide a method to request a recursive
  2870. download (unless the server supports MLSD; see [319]Section
  2871. 3.11), so this works only if the FTP server does it anyway,
  2872. without being asked, as some do. In this case, Kermit detects
  2873. that names in the returned file list contain directory
  2874. separators, and therefore attempts to create the needed
  2875. directories as the files arrive. But this can work only if the
  2876. server is on the same kind of platform as the client, so the
  2877. pathname syntax can be recognized, and also because the server
  2878. does not switch between text and binary mode, which would be
  2879. vital for cross-platform transfers. Use with caution. Synonym:
  2880. /SUBDIRECTORIES.
  2881. Even when the server does not provide recursive file lists,
  2882. [M]GET /RECURSIVE forces Kermit to replicate any directory
  2883. structure implied or expressed by the server's file list. For
  2884. example:
  2885. get somepath/somefile
  2886. Gets the file named somefile from the server's somepath
  2887. directory and puts it Kermit's current (or download) directory,
  2888. whereas:
  2889. get /recursive somepath/somefile
  2890. creates the path locally and then puts the file in it. Similarly
  2891. for MGET:
  2892. mget */data/*
  2893. downloads all the files in all the data subdirectories of all
  2894. the subdirectories of the server's current directory and stores
  2895. them locally in Kermit's current (or download) directory,
  2896. whereas:
  2897. mget /recursive */data/*
  2898. re-creates the server's directory structure locally.
  2899. The FTP protocol does not include explicit mechanisms for recursion, so
  2900. Kermit builds upon what is available. Although an Internet draft
  2901. describes a mechanism ("MLSD") that would allow protocol-driven
  2902. recursion, similar to Kermit's File Attribute packets (circa 1984), it
  2903. has not yet attained RFC or standard status, and servers are not yet
  2904. widely available that offer this feature. In the meantime, the
  2905. effectiveness of MGET /RECURSIVE depends on the FTP server
  2906. implementation. If the server returns a recursive list in response to
  2907. the standard NLST command (whose behavior is ill-defined), Kermit's FTP
  2908. MGET /RECURSIVE command uses it to re-create the remote directory tree
  2909. locally. If the server supports MLSD, C-Kermit 8.0.206 and Kermit 95
  2910. 2.1 and later are able to sense it automatically and use it, as
  2911. described below in [320]Section 3.11.
  2912. The /BEFORE:, /AFTER:, /NOT-BEFORE:, and /NOT-AFTER: switches are not
  2913. available for downloading because of the confusion with timezones.
  2914. Would the given times be in the local timezone, the server's timezone,
  2915. or GMT? The FTP server's directory listings show its own local times
  2916. but since we don't know what timezone the server is in, there's no way
  2917. to reconcile our local times with the server's. Similarly, /PERMISSIONS
  2918. can't be preserved in downloads because FTP protocol provides no means
  2919. of querying the server for a file's permission.
  2920. Source-file disposition switches:
  2921. /DELETE
  2922. Each file that is downloaded successfully is to be deleted from
  2923. the server. Requires the appropriate file access rights on the
  2924. server.
  2925. /SERVER-RENAME-TO:template
  2926. Asks the server to rename each (remote) source file immediately
  2927. after, and only if, it is sent correctly. See [321]PUT
  2928. /SERVER-RENAME-TO: for details.
  2929. Destination-file disposition switches:
  2930. /TO-SCREEN
  2931. Displays the incoming file on the screen rather than storing it
  2932. on disk. If this switch is given, the /RENAME-TO and /MOVE-TO
  2933. switches are ignored, the file-transfer display is suppressed,
  2934. and the given file(s) is/are shown on the screen. Can be used
  2935. with /FILTER, e.g.
  2936. get /text /to-screen /filter:more oofa.txt
  2937. In fact, you should always use /TO-SCREEN with /FILTER or
  2938. /COMMAND when the command would result in displaying the
  2939. incoming file on the screen; otherwise C-Kermit would have no
  2940. way of knowing to suppress its file transfer display (since it
  2941. can't be expected to know what the command or filter does).
  2942. /RENAME-TO:template
  2943. Each file that is downloaded is to be renamed as indicated if
  2944. and only if it was received completely and without error. The
  2945. template can be literal text or can contain variables that are
  2946. evaluated for each file. For MGET, the text must contain
  2947. variables; for GET it can be a literal string. The \v(filename)
  2948. variable contains the name of the current file, so:
  2949. ftp mget /rename-to:\v(filename).ok *
  2950. causes each file that is successfully downloaded to have ".ok"
  2951. appended to its name. For details see [322]Section 4.1 of the
  2952. [323]C-Kermit 7.0 Update Notes.
  2953. /MOVE-TO:text
  2954. Just like /RENAME-TO:, except the text denotes the name of a
  2955. directory to which successfully downloaded files are to be
  2956. moved. If the directory does not exist, it is created.
  2957. The file transfer display does not show the /MOVE-TO or /RENAME-TO
  2958. value, since the incoming file has not yet been moved or renamed.
  2959. 3.6.2. Filename Collisions
  2960. What should happen if an incoming file has the same name as an existing
  2961. file in the same directory? By default, Kermit's FILE COLLISION setting
  2962. applies: BACKUP, RENAME, UPDATE, DISCARD, etc, as described in
  2963. [324]Using C-Kermit. Kermit's default FILE COLLISION setting is BACKUP
  2964. (rename the existing file and store the incoming file under its own
  2965. name) and therefore this is also the default FTP collision action.
  2966. The name under which an incoming file is to be stored is determined as
  2967. follows:
  2968. * If an as-name was given, the as-name is used. Otherwise:
  2969. * If the client and server platforms are alike or [325]FTP FILENAMES
  2970. is set to LITERAL (or the /FILENAMES:LITERAL switch was given for
  2971. this download), the incoming filename is used literally. Otherwise:
  2972. * The incoming filename is converted to a form that is friendly to
  2973. the local platform. For UNIX, for example, incoming filenames that
  2974. are all uppercase (as they might be from, say, VMS or an IBM
  2975. mainframe) are converted to lowercase.
  2976. If the resulting name coincides with the name of a local file that
  2977. already exists, we have a filename collision. Collisions are handled
  2978. according to the currently selected collision action:
  2979. SET FTP COLLISION { BACKUP, RENAME, UPDATE, DISCARD, APPEND, OVERWRITE
  2980. }
  2981. This establishes a filename collision for FTP, separate from the
  2982. Kermit one. The initial FTP collision setting is inherited from
  2983. Kermit's FILE COLLISION setting when the first FTP command is
  2984. given, but subsequent changes to Kermit's FILE COLLISION setting
  2985. do not affect the FTP COLLISION setting. SHOW FTP tells the
  2986. current FTP COLLISION setting.
  2987. FTP GET /COLLISION:{BACKUP,RENAME,UPDATE,DISCARD,APPEND,OVERWRITE}
  2988. Overrides the current FTP COLLISION action for this download
  2989. only.
  2990. FTP GET /UPDATE
  2991. This is equivalent to GET /COLLISION:UPDATE, and is included for
  2992. symmetry with PUT /UPDATE
  2993. FTP GET /UPDATE and /COLLISION:UPDATE mean to download only those files
  2994. whose modification dates on the server are later than those on the
  2995. client. Date-time comparisons are done in Coordinated Universal Time
  2996. (UTC, GMT, ZULU). The command:
  2997. FTP MGET /COLLISION:APPEND /AS-NAME:newfilename *.*
  2998. Downloads all matching remote files into a single local file (in
  2999. whatever order the server sends them).
  3000. 3.6.3. Recovery
  3001. Recovery is available for downloads too, but there are some differences
  3002. from the uploading case described in [326]Section 3.5.3:
  3003. * The transfer must be in BINARY mode. It can not be in text mode,
  3004. even if the FTP server is on the same kind of platform as Kermit,
  3005. and even if there is no character-set translation. The original
  3006. download must also have been in binary mode.
  3007. * The FTP server must support the REST ("restart") directive.
  3008. Unfortunately, this is not a standard command; at this writing, it
  3009. is described only in an Internet Draft, not an RFC or Internet
  3010. Standard, but nevertheless it is found in several popular FTP
  3011. servers, such as [327]ProFTPD.
  3012. Here's how download recovery works:
  3013. * Kermit checks for conflicting switches, such as /UPDATE, /COMMAND,
  3014. or /FILTER. If /RECOVER is given with these switches an error
  3015. occurs.
  3016. * The prevailing transfer mode (SET FTP TYPE) must be BINARY. If it
  3017. is not, the /BINARY switch must have been included with the FTP
  3018. [M]GET command.
  3019. If the /RECOVER switch is accepted, then for each selected file:
  3020. * A SIZE command is sent for the file (using its remote name). If the
  3021. reply indicates the file was not found, or the SIZE command was not
  3022. understood, or any other kind of error, recovery is canceled (i.e.
  3023. the entire file is downloaded).
  3024. * If the sizes of the two files are identical, the file is not sent.
  3025. Otherwise:
  3026. * Kermit sends the REST directive to the server, indicating the size
  3027. of the local file. If the server responds affirmatively, Kermit
  3028. opens the local file in append mode and appends the incoming data
  3029. to it. Otherwise, recovery is canceled and the entire file is
  3030. downloaded.
  3031. The /RECOVER switch can be included with any FTP GET or MGET command,
  3032. even if it specifies a group of files. This lets you resume an
  3033. interrupted batch transfer from where it left off. The files that were
  3034. already completely sent are skipped, the file that was interrupted is
  3035. recovered, and the remaining files are uploaded. BUT... unlike with
  3036. uploading, where this can be done with any mixture of text and binary
  3037. files, when downloading, it can only be done if all the files are
  3038. binary.
  3039. It doesn't matter how the original partial file was downloaded -- FTP,
  3040. Kermit, HTTP, Zmodem, etc: as long as the preconditions are met, it can
  3041. be recovered with FTP [M]GET /RECOVER, or for that matter also with GET
  3042. /RECOVER (using Kermit protocol).
  3043. [ [328]Top ] [ [329]FTP Top ] [ [330]C-Kermit Home ] [ [331]Kermit Home
  3044. ]
  3045. 3.7. Translating Character Sets
  3046. A possibly unique feature of Kermit's FTP client is its ability to
  3047. convert character sets when transferring files in text mode,
  3048. independent of the capabilities of the FTP server, as well as to
  3049. translate the character sets of filenames regardless of transfer mode.
  3050. For compatibility with existing FTP clients, and because there is a
  3051. certain performance penalty, Kermit won't do this unless you ask for
  3052. it. If you enable this feature, you need to inform Kermit of the
  3053. character set (to be) used on the server and in some cases (explained
  3054. below) also the local file character set. This discussion assumes you
  3055. know a bit about character sets (as you must if you have to use them);
  3056. see Chapter 16 of [332]Using C-Kermit for a detailed treatment. The
  3057. Kermit commands for FTP character-set conversion are:
  3058. SET FTP CHARACTER-SET-TRANSLATION { ON, OFF }
  3059. Whether to translate character sets when transferring text files
  3060. with FTP. OFF by default. Set this to ON to enable character-set
  3061. translation for subsequent FTP uploads and downloads.
  3062. SET FTP SERVER-CHARACTER-SET [333]name
  3063. Text character set (to be) used by the server. Most FTP servers
  3064. are ignorant of character sets, so all translations are done
  3065. unilaterally by Kermit's FTP client. This means that when
  3066. downloading files, you must know in advance the character-set
  3067. used in the files you are downloading (and in their names). When
  3068. uploading, you must specify the character-set to which local
  3069. filenames and text-file contents are to be translated for
  3070. transmission to the server. If you SET FTP
  3071. CHARACTER-SET-TRANSLATION ON but do not specify an FTP
  3072. SERVER-CHARACTER-SET, [334]UTF8 is used, since this is the new
  3073. Internet standard international character set; it is upwards
  3074. compatible with ASCII and it encompasses most written languages
  3075. and therefore does not favor any particular group of people, as
  3076. any other default would do. If you SET FTP SERVER-CHARACTER-SET
  3077. to something (anything) when FTP CHARACTER-SET TRANSLATION is
  3078. OFF, this also sets the latter ON.
  3079. SET FILE CHARACTER-SET [335]name
  3080. This is the regular Kermit (non-FTP-specific) command for
  3081. identifying the character set (to be) used in local text files
  3082. and filenames.
  3083. TO REITERATE: If you SET FTP CHARACTER-SET TRANSLATION ON but do not
  3084. specify an FTP SERVER-CHARACTER-SET, outbound text files are converted
  3085. to UTF-8 and inbound text files are assumed to be UTF-8. If this is not
  3086. appropriate, be sure to also specify the desired FTP
  3087. SERVER-CHARACTER-SET.
  3088. You can use "special" (non-ASCII) characters in filenames in all the
  3089. client / server file management commands (FTP MKDIR, RMDIR, DIRECTORY,
  3090. VDIRECTORY, DELETE, etc), and also in file-transfer commands. When
  3091. giving commands such as FTP DIR (RDIR) and FTP PWD (RPWD), the reply is
  3092. translated too, so you can read it. In this example, the client and
  3093. server use entirely different codes to represent the special characters
  3094. of German:
  3095. C-Kermit> ftp xyzcorp.de /anonymous
  3096. C-Kermit> set ftp server-character-set latin1
  3097. C-Kermit> set file character-set german
  3098. C-Kermit> rcd Städte
  3099. C-Kermit> rpwd
  3100. "/pub/ftp/Städte is current directory"
  3101. C-Kermit> rdir
  3102. -rw-rw---- 1 olaf 54018 Jan 6 17:58 Adenbüttel.txt
  3103. -rw-rw---- 1 ursula 373 Jan 5 15:19 Aßlar.txt
  3104. -rw-rw---- 1 gisbert 482 Jan 5 15:20 Blowatz.txt
  3105. -rw-rw---- 1 gudrun 124 Jan 5 15:19 Böblingen.txt
  3106. -rw-rw---- 1 olga 14348 Jan 7 14:23 Köln.txt
  3107. When the client and server file systems use different character sets,
  3108. you should take care to use only those characters that the two sets
  3109. share in common when creating filenames or text-file contents. For
  3110. example, PC code pages contain a lot line- and box-drawing characters,
  3111. and sometimes "smart quotes", etc, that are not found in ISO standard
  3112. 8-bit character sets. You should be especially careful to avoid using
  3113. such characters in filenames.
  3114. [ [336]C-Kermit Character Sets ]
  3115. 3.7.1. Character Sets and Uploading
  3116. Kermit's PUT and MPUT commands include full file-scanning capabilities,
  3117. as described in [337]Section 4. Thus if FTP CHARACTER-SET-TRANSLATION
  3118. is ON and your character-set associations are set up appropriately,
  3119. Kermit automatically switches on a per-file basis between text and
  3120. binary mode, and for each text file between your chosen 7-bit text
  3121. character set (e.g. ASCII or ISO 646 German), 8-bit text (e.g. Latin-1
  3122. or Japanese EUC), UCS-2, and UTF-8, and converts each of these
  3123. automatically to the server character-set, and furthermore
  3124. automatically differentiates between the Little and Big Endian forms of
  3125. UCS-2, always sending in Big Endian form.
  3126. WARNING: It is not advisable to use UCS-2 (or any Unicode
  3127. transformation other than UTF-8) "on the wire", i.e. as a server
  3128. character set. Most FTP servers are not able to cope with it, since
  3129. it contains lots of 0 (NUL) characters. If you do use it, Kermit
  3130. does not translate filenames to or from UCS-2, for reasons well
  3131. known to C programmers (for example, UNIX APIs assume filename
  3132. strings are NUL-terminated). [338]UTF-8 is the preferred (and
  3133. standard) Unicode format for the Internet.
  3134. FTP character-set translations differ from the regular Kermit ones by
  3135. not restricting translations to a file-character-set /
  3136. transfer-character-set pair. You can have Kermit's FTP client translate
  3137. between any pair of character sets it knows about. You can see the list
  3138. of supported character sets by typing either of the following:
  3139. set ftp server-character-set ?
  3140. set file character-set ?
  3141. A typical list looks like this:
  3142. C-Kermit>set file char ? One of the following:
  3143. ascii cp869-greek hebrew-7 mazovia-pc
  3144. british cyrillic-iso hebrew-iso next-multinational
  3145. bulgaria-pc danish hp-roman8 norwegian
  3146. canadian-french dec-kanji hungarian portuguese
  3147. cp1250 dec-multinational iso2022jp-kanji shift-jis-kanji
  3148. cp1251-cyrillic dg-international italian short-koi
  3149. cp1252 dutch jis7-kanji spanish
  3150. cp437 elot927-greek koi8 swedish
  3151. cp850 elot928-greek koi8r swiss
  3152. cp852 euc-jp koi8u ucs2
  3153. cp855-cyrillic finnish latin1-iso utf8
  3154. cp858 french latin2-iso
  3155. cp862-hebrew german latin9-iso
  3156. cp866-cyrillic greek-iso macintosh-latin
  3157. C-Kermit>
  3158. Thus you can translate not only between private sets (like PC code
  3159. pages) and standard ones (like Latin-1) as in Kermit protocol, but also
  3160. between any given pair of private sets (e.g. CP852 and Mazovia). All
  3161. conversions go through Unicode as the intermediate character set,
  3162. resulting in a minimum of character loss, since Unicode is a superset
  3163. of all other character sets known to Kermit.
  3164. In addition to the SET commands listed above, the FTP PUT and MPUT
  3165. commands include switches that apply only to the current command:
  3166. /LOCAL-CHARACTER-SET:name
  3167. /SERVER-CHARACTER-SET:name
  3168. Use these switches to force a particular translation. These
  3169. switches override the global FTP CHARACTER-SET-TRANSLATION and
  3170. SERVER-CHARACTER-SET settings and also character-set
  3171. differentiation by file scanning for the duration of the PUT or
  3172. MPUT command. The file scan is still performed, however, to
  3173. determine whether the file is text or binary; thus these
  3174. switches do not affect binary files unless you also include the
  3175. /TEXT switch to force all files to be treated as text.
  3176. In other words, if you include one or both of these switches with a PUT
  3177. or MPUT command, they are used. Similarly, the /TRANSPARENT switch
  3178. disables character-set translation for the PUT or MPUT command despite
  3179. the prevailing FTP CHARACTER-SET-TRANSLATION and SERVER-CHARACTER-SET
  3180. settings.
  3181. When uploading, the FILE CHARACTER-SET setting is ignored unless you
  3182. have forced Kermit not to [340]scan local files by including a /TEXT or
  3183. /BINARY switch with your [M]PUT command, or by disabling automatic
  3184. text/binary switching in some other way.
  3185. Examples:
  3186. 1. Suppose you have a CP852 (East European) text file that you want to
  3187. upload and store in ISO Latin Alphabet 2 encoding:
  3188. ftp put /local-char:cp852 /server-char:latin2 magyar.txt
  3189. 2. Suppose you always want your text files converted to Latin-2 when
  3190. uploading with FTP. Then put:
  3191. set ftp server-character-set latin2
  3192. in your Kermit customization file, and then you can omit the
  3193. /SERVER-CHARACTER-SET: switch from your FTP PUT commands:
  3194. ftp put /local-char:cp852 magyar.txt
  3195. 3. Now suppose that all the text files on your PC are written in
  3196. Hungarian, but they have a variety of encodings, and you don't want
  3197. to have to include the /LOCAL-CHARACTER-SET: switch on every FTP
  3198. PUT command, or (more to the point) you want to be able to send a
  3199. mixture of these files all at once. Put these commands in your
  3200. Kermit customization file:
  3201. set ftp server-character-set latin2 ; ISO 8859-2
  3202. set file default 7-bit-character-set hungarian ; ISO 646 Hungarian
  3203. set file default 8-bit-character-set cp852 ; PC East European Code Page
  3204. and now PUT and MPUT will automatically detect and switch among ISO
  3205. 646 Hungarian, Code Page 852, UTF-8, and UCS-2 encodings,
  3206. translating each one to Latin-2 for uploading:
  3207. ftp put *.txt
  3208. And since binary files are also detected automatically, the latter can
  3209. be simplified to:
  3210. ftp put *
  3211. even when "*" matches a diverse collection of binary and text files,
  3212. because translations are skipped automatically for binary files.
  3213. 3.7.2. Character Sets and Downloading
  3214. The commands and switches are the same as for uploading, but automatic
  3215. character-set switching works differently, since Kermit can't scan the
  3216. server files in advance. Instead, the transfer mode (text or binary) is
  3217. based on the filenames; each name is compared with Kermit's list of
  3218. text name patterns and binary name patterns. If the name matches a
  3219. binary pattern (for example, if the filename is oofa.tar.gz and one of
  3220. the filename patterns is "*.gz"), the file is downloaded in binary
  3221. mode; otherwise if it matches a text pattern (e.g. oofa.txt matches
  3222. "*.txt"), it is transferred in text ("ascii") mode. Otherwise, it is
  3223. transferred in the prevailing FTP TYPE.
  3224. In C-Kermit 8.0, the pattern lists used with FTP GET are not the same
  3225. lists used with Kermit transfers, and can not be viewed with SHOW
  3226. PATTERNS, nor adjusted with ADD and REMOVE TEXT-PATTERNS and
  3227. BINARY-PATTERNS, or SET FILE TEXT-PATTERNS and BINARY-PATTERNS.
  3228. Configuration of the FTP patterns list will be added in a future
  3229. release.
  3230. Examples:
  3231. get /server-char:latin1 /local-char:cp850 Grüße.txt
  3232. In this command, the filename contains special characters, which
  3233. you enter using whatever character set your local computer uses,
  3234. in this case PC Code Page 850 (cp850). The command tells Kermit
  3235. (in case it didn't know already from its FILE CHARACTER-SET
  3236. setting) that the local character set is cp850 and the server's
  3237. character-set is ISO 8859-1 Latin Alphabet 1 (latin1). Kermit
  3238. translates the filename from cp850 to latin1 and sends the
  3239. latin1 name to the server. Since it's a text file (matches
  3240. "*.txt"), its contents are translated to cp850 on arrival, and
  3241. it is saved with a cp850 name.
  3242. mget /text /server:latin1 /local:utf8 *.txt
  3243. This command:
  3244. + Tells C-Kermit that the server's files are encoded in ISO
  3245. 8859-1 Latin Alphabet 1.
  3246. + Tells C-Kermit to translate the incoming files into Unicode
  3247. UTF-8 for storage.
  3248. + Asks the server to send all ".txt" files in text mode.
  3249. mget /server:latin1 /local:utf8 *
  3250. Tells Kermit to get all files from the server's directory,
  3251. switching between text and binary mode based on the filename.
  3252. The names of all the files are translated (to UTF-8 in this
  3253. case), but contents are translated (also to UTF-8) only for text
  3254. files.
  3255. Note that any pair of 8-bit character sets is likely to have some
  3256. incompatibilities. Any characters in the source file that do not have
  3257. equivalents in the destination file's character set are converted to
  3258. question marks. This applies to both filenames and to text file
  3259. contents.
  3260. Also note that the server's ability to accept special characters in
  3261. filenames depends on the particular server. For example:
  3262. get Grüße.txt
  3263. works with WU-FTPD, but:
  3264. mget Grüß*.txt
  3265. does not.
  3266. 3.7.3. RFC2640
  3267. [341]RFC2640, July 1999, specifies a method by which the FTP client and
  3268. server can negotiate the use of UTF8. However, RFC2640-capable servers
  3269. are rare to nonexistent at this writing, and in any case you don't need
  3270. them to be able to transfer text in UTF8. C-Kermit lets you upload and
  3271. download text files in any character set it knows about, converting to
  3272. or from any other character set it knows about, without the knowledge,
  3273. permission, or cooperation of the server, and regardless of its
  3274. capabilities.
  3275. [ [342]Top ] [ [343]FTP Top ] [ [344]C-Kermit Home ] [ [345]Kermit Home
  3276. ]
  3277. 3.8. FTP Command Shortcuts
  3278. C-Kermit's FTP client coexists with other C-Kermit functions by
  3279. requiring the "ftp" prefix for each FTP-related command: FTP OPEN, FTP
  3280. GET, FTP BYE, and so on. For interactive use, however, this can be
  3281. rather awkward and sometimes surprising, for example when a GET command
  3282. starts a Kermit GET rather than an FTP GET. In fact, many Kermit
  3283. commands might just as easily apply to an FTP connection: GET, PUT
  3284. (SEND), BYE, and CLOSE. The following command lets you choose how these
  3285. commands are interpreted:
  3286. SET GET-PUT-REMOTE { AUTO, KERMIT, FTP }
  3287. Controls the orientation of GET, PUT, REMOTE and other
  3288. file-transfer and client/server commands that might apply to
  3289. either Kermit or FTP. The default setting is AUTO, meaning that
  3290. these commands apply to FTP if an FTP connection is open, and to
  3291. Kermit otherwise. KERMIT means they always apply to Kermit, FTP
  3292. means they always apply to FTP.
  3293. Here is a complete list of affected commands:
  3294. Kermit Command FTP Equivalent
  3295. (none) FTP [ OPEN ]
  3296. LOGIN FTP USER
  3297. LOGOUT FTP RESET
  3298. BYE FTP BYE
  3299. FINISH FTP BYE
  3300. CLOSE FTP BYE
  3301. HANGUP FTP BYE
  3302. BINARY FTP TYPE BINARY
  3303. TEXT (or ASCII) FTP TYPE ASCII
  3304. SEND (or PUT) FTP PUT
  3305. MSEND (or MPUT) FTP MPUT
  3306. RESEND FTP PUT /RECOVER
  3307. CSEND FTP PUT /COMMAND
  3308. GET FTP GET
  3309. MGET FTP MGET
  3310. REGET FTP GET /RECOVER
  3311. REMOTE HELP (RHELP) FTP HELP
  3312. REMOTE CD (RCD) FTP CD (CWD)
  3313. REMOTE PWD (RPWD) FTP PWD
  3314. REMOTE DIRECTORY (RDIR) FTP DIRECTORY
  3315. REMOTE DELETE (RDEL) FTP DELETE
  3316. REMOTE MKDIR (RMKDIR) FTP MKDIR
  3317. REMOTE RMDIR (RRMDIR) FTP RMDIR
  3318. REMOTE RENAME (RRENAME) FTP RENAME
  3319. REMOTE TYPE (RTYPE) FTP TYPE
  3320. REMOTE EXIT (REXIT) FTP BYE
  3321. The commands in the right-hand column always access FTP. The commands
  3322. in the left column can access either Kermit protocol or FTP:
  3323. * When GET-PUT-REMOTE is set to KERMIT, or to AUTO when there is no
  3324. FTP connection, the commands in the left-hand column access Kermit
  3325. protocol, and those right-hand column are required for FTP.
  3326. * When GET-PUT-REMOTE is set to FTP, or to AUTO when there is an
  3327. active FTP connection, the commands in the left-hand column access
  3328. the FTP connection and can not be used to access Kermit protocol.
  3329. In this case, if you want to be able to use both Kermit protocol
  3330. and the FTP connection, you must SET GET-PUT-REMOTE KERMIT, and
  3331. then use the FTP commands in the right-hand column to access the
  3332. FTP connection.
  3333. Note that file-management commands such as DIRECTORY, DELETE, CD, PWD,
  3334. MKDIR, RMDIR, HELP, RENAME, COPY, TYPE, and so on, always apply
  3335. locally, no matter what kind of connection you have. This is the
  3336. opposite of most FTP clients, where these commands are intended for the
  3337. server, and require an "L" prefix for local execution (e.g. "dir" gets
  3338. a directory listing from the server, "ldir" gets a local directory
  3339. listing). To illustrate with the CD command and a typical UNIX FTP
  3340. client:
  3341. Client Server Change Local Directory Change Remote Directory
  3342. FTP FTP lcd cd (cwd)
  3343. Kermit Kermit cd rcd, remote cd
  3344. Kermit FTP cd ftp cd, rcd, remote cd
  3345. Also note that not all REMOTE commands are useful with FTP, since FTP
  3346. servers do not offer the corresponding functions. These include:
  3347. * REMOTE ASSIGN - FTP servers don't have variables
  3348. * REMOTE COPY - FTP servers don't copy files
  3349. * REMOTE HOST - FTP servers don't execute host (shell) commands
  3350. * REMOTE KERMIT - FTP servers don't execute Kermit commands
  3351. * REMOTE PRINT - FTP servers don't print files
  3352. * REMOTE QUERY - FTP servers don't have variables
  3353. * REMOTE SET - FTP servers don't have Kermit settings
  3354. * REMOTE WHO - FTP servers don't send user lists
  3355. Finally note that command shortcuts do not apply to the HELP command.
  3356. For help about an FTP command, use (for example) "help ftp delete", not
  3357. "help delete" or "help rdelete".
  3358. [ [346]Top ] [ [347]FTP Top ] [ [348]C-Kermit Home ] [ [349]Kermit Home
  3359. ]
  3360. 3.9. Dual Sessions
  3361. You can have an FTP session open at the same time as a regular Kermit
  3362. SET LINE or SET HOST (terminal) session. In this case, the default SET
  3363. GET-PUT-REMOTE AUTO setting should ensure that all "two-faced" commands
  3364. like GET, PUT, REMOTE, HANGUP, BYE, etc, apply to the Kermit session,
  3365. and all commands for the FTP session must include the FTP prefix. To be
  3366. absolutely certain, you can use SET GET-PUT-REMOTE KERMIT.
  3367. ftp foo.bar.baz.com
  3368. if fail ...
  3369. (log in)
  3370. set host foo.bar.baz.com
  3371. if fail ...
  3372. (log in)
  3373. Now you have both an FTP and Telnet connection to the same host (of
  3374. course they could also be to different hosts, and you could also have a
  3375. direct or dialed serial connection instead of a Telnet connection). Now
  3376. assuming you have a Kermit server on the far end of the Kermit
  3377. connection:
  3378. rcd incoming ; Changes Kermit server's directory (= REMOTE CD)
  3379. ftp cd incoming ; Changes FTP server's directory
  3380. put oofa.txt ; Sends a file on the Kermit connection
  3381. ftp put oofa.txt ; Sends a file on the FTP connection
  3382. bye ; Shuts down the Kermit connection
  3383. ftp bye ; Shuts down the FTP connection
  3384. Note that PUT and SEND are synonyms for both FTP and Kermit
  3385. connections.
  3386. You can also establish dual sessions on the Kermit command line:
  3387. kermit -j host1 -9 host2
  3388. This makes a Telnet connection to host1 and an FTP connection to host2.
  3389. [ [350]Top ] [ [351]FTP Top ] [ [352]C-Kermit Home ] [ [353]Kermit Home
  3390. ]
  3391. 3.10. Automating FTP Sessions
  3392. Most of Kermit's scripting features can be used to make and control FTP
  3393. sessions: FOR and WHILE loops, IF-ELSE and SWITCH constructions,
  3394. variables, arrays, built-in functions, and all the rest. You can't use
  3395. INPUT, MINPUT, OUTPUT, CLEAR, or SCRIPT on an FTP session, but these
  3396. are not needed since the FTP protocol is well defined.
  3397. 3.10.1. FTP-Specific Variables and Functions
  3398. The following variable tells whether an FTP connection is open:
  3399. \v(ftp_connected)
  3400. 1 if there is an active FTP connection, 0 if there isn't.
  3401. The FTP OPEN command sets:
  3402. \v(ftp_host)
  3403. The host to which the most recent FTP connection was made.
  3404. \v(ftp_security)
  3405. The security method negotiated for the current FTP session. The
  3406. value is "NULL" when no security is used. Other possibilities
  3407. are GSSAPI, KERBEROS_V4, SSL, TLS, and SRP. Also see
  3408. \v(authname), \v(authstate), and \v(authtype). See [355]3.2.
  3409. Making Secure FTP Connections.
  3410. \v(ftp_server)
  3411. The OS type (UNIX, VMS, etc) of the FTP server host.
  3412. The FTP USER command (or FTP OPEN /USER:, or FTP with automatic login)
  3413. sets:
  3414. \v(ftp_loggedin)
  3415. 1 if you are logged in to an FTP server, 0 if you are not.
  3416. The current COMMAND-PROTECTION-LEVEL and DATA-PROTECTION-LEVEL values
  3417. are reflected in:
  3418. \v(ftp_cpl)
  3419. \v(ftp_dpl)
  3420. The values are "clear", "confidential", "safe" or "private". See
  3421. [356]3.2. Making Secure FTP Connections.
  3422. The FTP GET-PUT-REMOTE setting is reflected in:
  3423. \v(ftp_getputremote)
  3424. The values are "auto", "ftp", or "kermit".
  3425. Every FTP command sets the \v(success) variable, as well as the
  3426. following two FTP-specific variables:
  3427. \v(ftp_code)
  3428. The standardized numeric FTP protocol code from the server's
  3429. response to the last client command, a 3-digit decimal number
  3430. defined in [357]RFC959. Briefly:
  3431. 1xx = Positive Preliminary Reply
  3432. 2xx = Positive Completion Reply
  3433. 3xx = Positive Intermediate Reply
  3434. 4xx = Transient Negative Completion Reply
  3435. 5xx = Permanent Negative Completion Reply
  3436. \v(ftp_message)
  3437. The text message, if any, from the server's response to the last
  3438. client command. If the most recent response had multiple lines,
  3439. this variable has only the final line. These messages are not
  3440. standardized and vary in format and content from server to
  3441. server. Synonym: \v(ftp_msg).
  3442. FTP file transfers set the regular Kermit transfer status variables:
  3443. \v(cps) Characters per second of most recent transfer.
  3444. \v(filespec) File specification used in most recent transfer.
  3445. \v(fsize) Size of file most recently transferred.
  3446. \v(tfsize) Total size of file group most recently transferred.
  3447. \v(xferstatus) Status of most recent transfer (0 = success, 1 = failure).
  3448. \v(tftime) Elapsed time of most recent transfer, in seconds.
  3449. During an FTP transfer, the per-file variables are:
  3450. \v(filename) Name of current file.
  3451. \v(filenumber) Ordinal file number in group (1, 2, 3, ...)
  3452. 3.10.2. Examples
  3453. Let's begin with a simple example showing how to log in, send some
  3454. files, and log out:
  3455. define error if fail { ftp bye, stop 1 Error: \%1 }
  3456. set transact brief
  3457. log t
  3458. ftp ftp.xyzcorp.com /anonymous
  3459. if fail stop 1 Connection failed
  3460. if not \v(ftp_loggedin) stop 1 Login failed
  3461. ftp cd incoming
  3462. error {ftp cd}
  3463. cd upload
  3464. error {local cd}
  3465. ftp put /delete *
  3466. error {put}
  3467. ftp bye
  3468. First we define an error handling macro to be used after the connection
  3469. is made. Then we set up a brief-format transaction log to keep a record
  3470. of our file transfers. Then we make a connection to the host and log in
  3471. anonymously. The "if fail" command checks whether the connection was
  3472. made. The "if not" command checks whether login was successful.
  3473. Obviously the script should not continue unless both tests succeed.
  3474. Next we change to the server's 'incoming' directory and to our own
  3475. 'upload' directory, and send all the files that are in it (they can be
  3476. any mixture of text and binary files), deleting each source file
  3477. automatically after it is successfully uploaded. Each of these
  3478. operations is checked with the ERROR macro, which prevents the script
  3479. from continuing past a failure.
  3480. Finally we close the FTP session with the "bye" command.
  3481. Just like any other Kermit script, this one can be used in many ways:
  3482. * It can be stored in a file, and Kermit can be told to TAKE the
  3483. file.
  3484. * In UNIX, it can be a "[358]kerbang" script and therefore run
  3485. directly from the shell prompt or as a cron job.
  3486. We could have used command shortcuts like "rcd", "put", and "bye", but
  3487. since they can be ambiguous under certain circumstances, it is better
  3488. to avoid them in scripts; they are intended mainly for convenience
  3489. during interactive use. However, if you wish to use the shortcuts in a
  3490. script, you can do it this way (error handling omitted for brevity):
  3491. local \%t ; Declare a local temporary variable
  3492. assign \%t \v(ftp_getputremote) ; Save current FTP GET-PUT-REMOTE setting
  3493. set ftp get-put-remote ftp ; Choose FTP orientation
  3494. ftp xyzcorp.com /anonymous ; Open an FTP connection
  3495. get oofa.txt ; GET a file
  3496. put foo.bar ; PUT a file
  3497. rdel yesterday.log ; Delete a file on the server
  3498. bye ; Log out and disconnect from server.
  3499. set ftp get-put-remote \%t ; Restore previous GET-PUT-REMOTE setting
  3500. Of course, FTP scripts can also be written as macros. This lets you
  3501. pass parameters such as hostnames, usernames, and filenames to them:
  3502. define doftpget {
  3503. if < \v(argc) 4 end 1 Usage: \%0 host user remotefile [ localfile ]
  3504. ftp \%1 /user:\%2
  3505. if fail end 1 FTP OPEN \%1 failed
  3506. if not \v(ftp_loggedin) end 1 FTP LOGIN failed
  3507. ftp get {\%3} {\%4}
  3508. if fail end 1 FTP GET \%3 failed
  3509. ftp bye
  3510. }
  3511. Add this definition to your Kermit customization file, and it will
  3512. always be available when you start Kermit. This macro lets you download
  3513. a file with FTP by giving a single command, e.g.:
  3514. doftpget xyzcorp.com anonymous oofa.txt
  3515. 3.10.3. Automating Secure FTP Sessions
  3516. Often when making secure connections, you are prompted interactively
  3517. for certain information or permission to proceed. These prompts can
  3518. stop an automated procedure. To avoid them, you must give the
  3519. appropriate commands to disable them, and/or supply the prompted-for
  3520. information beforehand. Here are a few hints:
  3521. * Make sure that SET TAKE ERROR and SET MACRO ERROR are both OFF.
  3522. This is the default, but in case you have set either one of these
  3523. ON in your script or initialization file, this makes the script
  3524. halt on any kind of error. Normally you would want to check each
  3525. operation for success or failure and take appropriate action.
  3526. * On SSL and TLS connections, you may be asked whether it is OK to
  3527. proceed with a connection to server that presents a self-signed
  3528. certificate. You can use the SET AUTHENTICATION SSL (or TLS) VERIFY
  3529. or SET AUTH SSL (or TLS) CERTS-OK commands to avoid this prompt by
  3530. not requesting a certificate from the peer.
  3531. * (More to be added...)
  3532. [ [359]Top ] [ [360]FTP Top ] [ [361]FTP Script Tutorial ] [
  3533. [362]C-Kermit Home ] [ [363]Kermit Home ]
  3534. 3.11. Advanced FTP Protocol Features
  3535. The remainder of the FTP documentation (through the end of Section 3)
  3536. is new to C-Kermit 8.0.206, but we leave it in black to prevent
  3537. headaches. Except for titles.
  3538. * [364]TERMINOLOGY
  3539. * [365]FEATURE NEGOTIATION
  3540. * [366]USING MGET: NLST VERSUS MLSD
  3541. * [367]EXAMPLES
  3542. * [368]REFERENCES
  3543. The new releases of [369]C-Kermit (8.0.206) and [370]Kermit 95 (2.1)
  3544. support new FTP protocol features from RFC 2389 as well as most of
  3545. what's in the Elz and Hethmon Extensions to FTP Internet Draft (see
  3546. [371]References). Some of these features, such as SIZE (request a
  3547. file's size), MDTM (request file's modification time), and REST
  3548. (restart interrupted transfer) have been widely implemented in FTP
  3549. clients and servers for years (as well as in the initial release of the
  3550. Kermit FTP clients). Others such as FEAT and MLSD are rarely seen and
  3551. are new to the upcoming Kermit releases. TVFS (Trivial Virtual File
  3552. Store) is supported implicitly, and the UTF-8 character-set is already
  3553. fully supported at the protocol and data-interchange level.
  3554. For Kermit users, the main benefit of the new FTP protocol extensions
  3555. is the ability to do recursive downloads. But the extensions also
  3556. introduce complications and tradeoffs that you should be aware of. Of
  3557. course Kermit tries to "do the right thing" automatically in every case
  3558. for backwards compatibility. But (as noted later) some cases are
  3559. inherently ambiguous and/or can result in nasty surprises, and for
  3560. those situations new commands and switches are available to give you
  3561. precise control over Kermit's behavior, in case the defaults don't
  3562. produce the desired results.
  3563. 3.11.1. Terminology
  3564. Command-line FTP clients such as Kermit (as well as the traditional FTP
  3565. programs found on Unix, VMS, ..., even Windows) have commands like PUT,
  3566. MPUT, GET, MGET, and BYE, which they convert into zero or more FTP
  3567. protocol commands, such as NLST, RETR, QUIT. For clarity, we'll use
  3568. "command" to refer to commands given by the user to the FTP client, and
  3569. "directive" for FTP protocol commands sent by the FTP client to the FTP
  3570. server.
  3571. 3.11.2. Feature Negotiation
  3572. New FTP protocol features are negotiated by the client sending a FEAT
  3573. directive and the server responding with a list of (new) features it
  3574. supports, or else with an error indication if it does not support the
  3575. FEAT directive at all, in which case the client has to guess which new
  3576. features it supports (Kermit guesses that it supports SIZE and MDTM but
  3577. not MLST). Note that the MLST feature includes MLSD, which is not
  3578. listed separately as a feature.
  3579. Guessing is nice when it works, but sometimes it doesn't, and some FTP
  3580. servers become confused when you send them a directive they don't
  3581. understand, or they do something you didn't want, sometimes to the
  3582. point of closing the connection. For this reason, Kermit lets you
  3583. override default or negotiated features with the following new
  3584. commands:
  3585. FTP { ENABLE, DISABLE } FEAT
  3586. Enables or disables the automatic sending of a FEAT directive
  3587. upon connection to an FTP server. Note that FTP [ OPEN ] /NOINIT
  3588. also inhibits sending the FEAT directive (and several others)
  3589. for the connection being OPEN'd, but without necessarily
  3590. disabling FEAT for subsequent connections in the same Kermit
  3591. instance. FEAT is ENABLED by default, in which case many FTP
  3592. servers are likely to reply:
  3593. 500 'FEAT': command not understood
  3594. which is normally harmless (but you never know). (In C-Kermit
  3595. 8.0.208, this error message is suppressed unless you SET FTP
  3596. DEBUG ON.)
  3597. FTP ENABLE { MDTM, MLST, SIZE }
  3598. Enables the given directive for implicit use by the FTP GET and
  3599. MGET commands in case it has been disabled or erroneously
  3600. omitted by the server in its FEAT response. Note: MLSD can be
  3601. used in the FTP ENABLE and DISABLE commands as a synonym for
  3602. MLST. YOU MUST GIVE THIS COMMAND AFTER MAKING THE FTP
  3603. CONNECTION.
  3604. FTP DISABLE { MDTM, MLST, SIZE }
  3605. Disables implicit use of the given directive by GET or MGET in
  3606. case it causes problems; for example, because it makes multifile
  3607. downloads take too long or the server announces it erroneously
  3608. or misimplements it. Use DISABLE FEAT before making a connection
  3609. to prevent Kermit from sending the FEAT directive as part of its
  3610. initial sequence. Note that disabling FEAT, SIZE, or MDTM does
  3611. not prevent you from executing explicit FTP FEATURES, FTP SIZE,
  3612. or FTP MODTIME commands. Also note that disabling SIZE prevents
  3613. PUT /RESTART (recovery of interrupted uploads) from working. YOU
  3614. MUST GIVE THIS COMMAND AFTER MAKING THE FTP CONNECTION.
  3615. To enable or disable more than one feature, use multiple FTP ENABLE or
  3616. FTP DISABLE commands. The SHOW FTP command shows which features are
  3617. currently enabled and disabled.
  3618. FTP FEATURES
  3619. This command sends a FEAT directive to the server. In case you
  3620. have been disabling and enabling different features, this
  3621. resynchronizes Kermit's feature list with the server's. If the
  3622. server does not support the FEAT directive, Kermit's feature
  3623. list is not changed.
  3624. FTP OPTIONS directive
  3625. Informational only: the server tells what options, if any, it
  3626. supports for the given directive, e.g. MLST. Fails if the server
  3627. does not support the OPTS directive or if the directive for
  3628. which options are requested is not valid. The directive is
  3629. case-insensitive.
  3630. FTP SIZE filename
  3631. Sends a SIZE directive to the server for the given file. The
  3632. filename must not contain wildcards. The server responds with an
  3633. error if the file can't be found, is not accessible, or the SIZE
  3634. directive is not supported, otherwise with the length of the
  3635. file in bytes, which Kermit displays and also makes available to
  3636. you in its \v(ftp_message) variable. If the directive is
  3637. successful, Kermit (re-)enables it for internal use by the GET
  3638. and MGET directives on this connection.
  3639. FTP MODTIME filename
  3640. Works just like the SIZE directive except it sends an MDTM
  3641. directive. Upon success, the server sends modification date-time
  3642. string, which Kermit interprets for you and also makes available
  3643. in its \v(ftp_message) variable.
  3644. Whenever a SIZE or MDTM directive is sent implicitly and rejected by
  3645. the server because it is unknown, Kermit automatically disables it.
  3646. 3.11.3. Using MGET: NLST versus MLSD
  3647. When you give an MGET command to an FTP client, it sends a request to
  3648. the FTP server for a list of files, and then upon successful receipt of
  3649. the list, goes through it and issues a RETR (retrieve) directive for
  3650. each file on the list (or possibly only for selected files).
  3651. With the new FTP protocol extensions, now there are two ways to get the
  3652. list of files: the NLST directive, which has been part of FTP protocol
  3653. since the beginning, and the new MLSD directive, which is new and not
  3654. yet widely implemented. When NLST is used and you give a command like
  3655. "mget *.txt", the FTP client sends:
  3656. NLST *.txt
  3657. and the server sends back a list of the files whose names match, e.g.
  3658. foo.txt
  3659. bar.txt
  3660. baz.txt
  3661. Then when downloading each file, the client sends SIZE (if it wants
  3662. have a percent-done display) and MDTM (if it wants to set the
  3663. downloaded file's timestamp to match that of the original), as well as
  3664. RETR (to retrieve the file).
  3665. But when MLSD is used, the client is not supposed to send the filename
  3666. or wildcard to the server; instead it sends an MLSD directive with no
  3667. argument (or the name of a directory), and the server sends back a list
  3668. of all the files in the current or given directory; then the client
  3669. goes through the list and checks each file to see if it matches the
  3670. given pattern, the rationale being that the user knows only the local
  3671. conventions for wildcards and not necessarily the server's conventions.
  3672. So with NLST the server interprets wildcards; with MLSD the client
  3673. does.
  3674. The interpretation of NLST wildcards by the server is not
  3675. necessarily required or even envisioned by the FTP protocol
  3676. definition (RFC 959), but in practice most clients and servers work
  3677. this way.
  3678. The principal advantage of MLSD is that instead of sending back a
  3679. simple list of filenames, it sends back a kind of database in which
  3680. each entry contains a filename together with information about the
  3681. file: type, size, timestamp, and so on; for example:
  3682. size=0;type=dir;perm=el;modify=20020409191530; bin
  3683. size=3919312;type=file;perm=r;modify=20000310140400; bar.txt
  3684. size=6686176;type=file;perm=r;modify=20001215181000; baz.txt
  3685. size=3820092;type=file;perm=r;modify=20000310140300; foo.txt
  3686. size=27439;type=file;perm=r;modify=20020923151312; foo.zip
  3687. (etc etc...)
  3688. (If the format of the file list were the only difference between NLST
  3689. and MLSD, the discussion would be finished: it would always be better
  3690. to use MLSD when available, and the MGET user interface would need no
  3691. changes. But there's a lot more to MLSD than the file-list format; read
  3692. on...)
  3693. The client learns whether the server supports MLSD in FEAT exchange.
  3694. But the fact that the server supports MLSD doesn't mean the client
  3695. should always use it. It is better to use MLSD:
  3696. * On connections where the server imposes a time penalty for every
  3697. command, e.g. the Red Hat Rawhide server. With MLSD, the client
  3698. needs to send only one command (RETR) per file, whereas NLST
  3699. requires three (SIZE, RETR, and MDTM). Suppose there is a 30-second
  3700. delay for each command and 1000 files are to be fetched; in that
  3701. case, MLSD saves 60,000 seconds = 1000 minutes = 16 hours and 40
  3702. minutes.
  3703. * For recursive downloads since there is no dependable way to
  3704. download directory trees with NLST.
  3705. But it is better to use NLST:
  3706. * If you want only a couple short files out of a large directory. In
  3707. this case, NLST is the better choice since the server sends a list
  3708. of only the files you want, not a list of (say) a million files,
  3709. which can make a big difference on slow connections. For example,
  3710. suppose your wildcard matches three files of 1K each, but the
  3711. million-file listing is 80MB long, and your connection is through a
  3712. modem. The overhead of using MLSD is practically infinite.
  3713. * If the server supports wildcarding features not known to the
  3714. client, but that can be used to achieve desirable effects otherwise
  3715. unobtainable, such as "[dir...]*.txt" in VMS or AOS/VS "except"
  3716. clauses.
  3717. * If you have been given a wildcard string by an FTP site
  3718. administrator for fetching a specific group of files out of a
  3719. larger directory, e.g. "mget ck[cuw]*.[cwh] makefile", that is
  3720. expected to work with any client (an FTP site administrator can't
  3721. be expected to know the wildcard syntax of every FTP client).
  3722. But when using MLSD there are complications:
  3723. * MLSD wants either a blank argument (meaning the current directory)
  3724. or else the name of a specific directory. The client must not send
  3725. it a wildcard or a filename.
  3726. * But if the user's command is "mget xxx", how does the client know
  3727. whether to send "xxx" in the MLSD directive? It might be the name
  3728. of a directory on on the server, in which case it should be sent,
  3729. or it might be the name of a file on the server (or a wildcard), in
  3730. which case it must not be sent. Since the client knows its own
  3731. wildcard syntax, then in most cases it would be right to send
  3732. "MLSD" with no argument if xxx is wild, and to send "MLSD xxx" if
  3733. it is not.
  3734. * But suppose the server's file system allows filename characters
  3735. that correspond with the client's wildcard syntax? For example:
  3736. "[abc]" could be either a valid VMS directory name or a wildcard
  3737. pattern used by the FTP client. What should the client do with
  3738. "mget [abc]"? In this case there must be a way for the user to
  3739. force sending the MGET argument as the MLSD argument.
  3740. * If "xxx" is a regular file in the server's current directory, "mget
  3741. xxx" works with NLST but not with MLSD.
  3742. To further complicate matters, NLST can (in theory) work just like
  3743. MLSD: if sent with a blank argument or a directory name, it is supposed
  3744. to return a complete list of files in the current or given directory,
  3745. which the client can match locally against some pattern. It is not
  3746. known if any FTP server or client does this but nevertheless, it should
  3747. be possible since this behavior can be inferred from RFC 959.
  3748. In view of these considerations, and given the need to preserve the
  3749. traditional FTP client command structure and behavior so the software
  3750. will be usable by most people:
  3751. 1. The MGET command should produce the expected result in the common
  3752. cases, regardless of whether NLST or MLSD is used underneath.
  3753. 2. For anomalous cases, the user needs a way to control whether the
  3754. MGET argument is sent to the server or kept for local use.
  3755. 3. At the same time, the user might need a way to send a directory
  3756. name to the server, independent of any wildcard pattern.
  3757. 4. The user needs a way to force NLST or MLSD for a given MGET
  3758. command.
  3759. By default, Kermit's MGET command uses MLSD if MLST is reported by the
  3760. server in its FEAT list. When MLSD is used, the filespec is sent to the
  3761. server if it is not wild (according to Kermit's own definition of
  3762. "wild" since it can't possibly know the server's definition). If the
  3763. filespec is wild it is held for local use to select files from the list
  3764. returned by the server. If MLST is not reported by the server or is
  3765. disabled, Kermit sends the MGET filespec with the NLST directive.
  3766. The default behavior can be overridden globally with FTP DISABLE MLST,
  3767. which forces Kermit to use NLST to get file lists. And then for
  3768. situations in which MLSD is enabled, the following MGET switches can be
  3769. used to override the defaults for a specific MGET operation:
  3770. /NLST
  3771. Forces the client to send NLST. Example:
  3772. mget /nlst foo.*
  3773. /MLSD
  3774. Forces the client to send MLSD (even if MLST is disabled).
  3775. Example:
  3776. mget /mlsd foo.*
  3777. /MATCH:pattern
  3778. When this switch is given, it forces the client to hold the
  3779. pattern for local use against the returned file list. If a
  3780. remote filespec is also given (e.g. the "blah" in "mget
  3781. /match:*.txt blah"), then it is sent as the NLST or MLSD
  3782. argument, presumably to specify the directory whose files are to
  3783. be listed. When the /MATCH switch is not given, the MGET
  3784. filespec is sent to the server if the directive is NLST or if
  3785. the filespec is not wild. Examples:
  3786. Command: With NLST: With MLSD:
  3787. mget NLST MLSD
  3788. mget *.txt NLST *.txt MLSD
  3789. mget foo NLST foo MLSD foo
  3790. mget /match:*.txt NLST MLSD
  3791. mget /match:*.txt foo NLST foo MLSD foo
  3792. In other words, the pattern is always interpreted locally unless MGET
  3793. uses NLST and no /MATCH switch was given.
  3794. 3.11.4. Examples
  3795. 3.11.4.1. Downloading a Single File
  3796. There are no choices here, just use the FTP GET command. Kermit always
  3797. sends the RETR directive, and possibly SIZE and/or MDTM. The small
  3798. advantage of using MLST in this case is outweighed by the risk and
  3799. effort of coding a special case.
  3800. 3.11.4.2. Downloading a Group of Files from a Single Directory
  3801. This case presents tradeoffs, especially on slow connections:
  3802. * For downloading all or most of the files in a directory, MLSD is
  3803. better because it eliminates the need to send SIZE and MDTM for
  3804. each file. No special actions are required in this case; Kermit
  3805. uses MLSD automatically if the server supports it (unless you have
  3806. disabled it).
  3807. * For a small number of files from a large directory, NLST is better
  3808. because it bypasses downloading of a potentially huge file list
  3809. prior to the files themselves. If you have a connection to a server
  3810. that supports MLSD, use the /NLST switch to force NLST:
  3811. mget /nlst t[1234].h
  3812. * If the server supports MLSD but does not support separate SIZE or
  3813. MDTM directives, and you need the size and/or timestamp
  3814. information, MLSD is better; no special actions required.
  3815. * If the server supports MLSD but does not support the "size" and
  3816. "modify" facts, but it does support the SIZE or MDTM directives,
  3817. and you need the size and/or timestamp information, NLST is better.
  3818. 3.11.4.3. Downloading a Directory Tree
  3819. MLSD is the only choice for recursive downloads; they rarely, if ever,
  3820. work with NLST (the few cases where they do work rely on extra-protocol
  3821. "secret" notations for the NLST argument). No special actions are
  3822. required to force MLSD when the server supports it, unless you have
  3823. disabled it. Examples:
  3824. MGET /RECURSIVE
  3825. This tells the server to send all files and directories in the
  3826. tree rooted at its current directory.
  3827. MGET /RECURSIVE *.txt
  3828. This tells the server to send all *.txt files in the tree rooted
  3829. at its current directory.
  3830. MGET /MLSD /RECURSIVE *.txt
  3831. Same as the previous example but forces Kermit to send MLSD in
  3832. case it was disabled, or in case the server is known to support
  3833. it even though it did not announce it in its FEAT listing.
  3834. MGET /RECURSIVE /MATCH:*.zip archives
  3835. Tells the server to send all ZIP files in the tree rooted at its
  3836. "archives" directory.
  3837. MGET /RECURSIVE /MATCH:* [abc]
  3838. The server is running on VMS and you want it to send all the
  3839. files in the directory tree rooted at [ABC]. But since "[abc]"
  3840. looks just like a wildcard, you have to include a /MATCH: switch
  3841. to force Kermit to send "[abc]" as the MLSD argument.
  3842. In all cases in which the /RECURSIVE switch is included, the server's
  3843. tree is duplicated locally.
  3844. Although MLSD allows recursion and NLST does not, the MLSD
  3845. specification places a heavy burden on the client; the obvious,
  3846. straightforward, and elegant implementation (depth-first, the one
  3847. that Kermit currently uses) requires as many open temporary files as
  3848. the server's directory tree is deep, and therefore client resource
  3849. exhaustion -- e.g. exceeding the maximum number of open files -- is
  3850. a danger. Unfortunately MLSD was not designed with recursion in
  3851. mind. (Breadth-first traversal could be problematic due to lack of
  3852. sufficient navigation information.)
  3853. Of course all of Kermit's other MGET switches can be used too, e.g. for
  3854. finer-grained file selection (by date, size, etc), for moving or
  3855. renaming files as they arrive, to override Kermit's automatic per-file
  3856. text/binary mode switching, to pass the incoming files through a
  3857. filter, to convert text-file character sets, and so on.
  3858. 3.11.4.4. NLST/MLSD Summary Table
  3859. Here's a table summarizing MGET behavior when the server supports both
  3860. NLST and MLSD. /NLST and /MLSD switches are included for clarity to
  3861. indicate which protocol is being used, and the expected effects. In
  3862. practice you can omit the /NLST and /MLSD switches and the Kermit
  3863. client chooses the appropriate or desired protocol as described above.
  3864. Sample commands presume a Unix file system on the server, but of course
  3865. the server can have any file system or syntax at all.
  3866. User's Command FTP Sends Remarks
  3867. mget /nlst NLST Gets a list of all the files in the server's current
  3868. and downloads each file. The list includes names only, so Kermit also
  3869. must send SIZE and MDTM directives if size and timestamp information is
  3870. required (this is always true of NLST). Sending NLST without an
  3871. argument is allowed by the RFC959 NLST definition and by the Kermit FTP
  3872. client, but might not work with other clients, and also might not work
  3873. with every server.
  3874. mget /nlst foo NLST foo If "foo" is a directory, this gets a list of
  3875. all the files from the server's "foo" directory and downloads each
  3876. file; otherwise this downloads the file named "foo" (if any) from the
  3877. server's current directory.
  3878. mget /nlst *.txt NLST *.txt Gets a list of the files in the server's
  3879. current directory whose names match the pattern *.txt, and then
  3880. downloads each file from the list. Because we are using NLST, we send
  3881. the filespec (*.txt) to the server and the server interprets any
  3882. wildcards.
  3883. mget /nlst foo/*.txt NLST foo/*.txt Gets a list of the files in the
  3884. server's "foo" directory whose names match the pattern *.txt, and then
  3885. downloads each file from the list (server interprets wildcards).
  3886. mget /nlst /match:*.txt NLST Gets a list of all the files in the
  3887. server's current directory and then downloads each one whose name
  3888. matches the pattern *.txt (client interprets wildcards).
  3889. mget /nlst /match:*.txt foo NLST foo Gets a list of all the files in
  3890. the server's "foo" directory and then downloads each one whose name
  3891. matches the pattern *.txt (client interprets wildcards).
  3892. mget /mlsd MLSD Gets a list of all the files from the server's current
  3893. directory and then downloads each one. The list might include size and
  3894. timestamp information, in which case Kermit does not need to send SIZE
  3895. and MDTM directives for each file (this is always true of MLSD).
  3896. mget /mlsd foo MLSD foo Gets a list of all the files from the server's
  3897. "foo" directory (where the string "foo" does not contain wildcards) and
  3898. then downloads each one. If "foo" is a regular file and not a
  3899. directory, this command is supposed to fail, but some servers have been
  3900. observed that send the file.
  3901. mget /mlsd *.txt MLSD Gets a list of all the files from the server's
  3902. current directory and then downloads only the ones whose names match
  3903. the pattern "*.txt". Because we are using MLSD and the MGET filespec is
  3904. wild, we do not send the filespec to the server, but treat it as though
  3905. it had been given in a /MATCH: switch and use it locally to match the
  3906. names in the list.
  3907. mget /mlsd foo/*.txt MLSD This one won't work because MLSD requires
  3908. that the notions of server directory and filename-matching pattern be
  3909. separated. However, the client, which can't be expected to know the
  3910. server's file-system syntax, winds up sending a request that the server
  3911. will (or should) reject.
  3912. mget /mlsd /match:*.txt MLSD Gets a list of all the files from the
  3913. server's current directory and then downloads only the ones whose names
  3914. match the pattern "*.txt" (client interprets wildcards).
  3915. mget /mlsd /match:*.txt foo MLSD foo If "foo" is a directory on the
  3916. server, this gets a list of all the files from the server's "foo"
  3917. directory and then downloads only the ones whose names match the
  3918. pattern "*.txt" (client interprets wildcards). This leaves the server
  3919. CD'd to the "foo" directory; there's no way the client can restore the
  3920. server's original directory because MLSD doesn't give that information,
  3921. and since the client can not be expected to know the server's
  3922. file-system syntax, it would not be safe to guess. If "foo" is a
  3923. regular file, MLSD fails.
  3924. mget /mlsd foo bar MLSD This one is problematic. You're supposed to be
  3925. able to give MGET a list a filespecs; in this case we name two
  3926. directories. The client must change the server's directory to "foo" to
  3927. get the list of files, and then the files themselves. But then it has
  3928. no way to return to the server's previous directory in order to do the
  3929. same for "bar", as explained in the previous example.
  3930. mget /mlsd /match:* [abc] MLSD [abc] Including a /MATCH: switch forces
  3931. [abc] to be sent to the server even though the client would normally
  3932. think it was a wildcard and hold it for local interpretation. In this
  3933. example, [abc] might be a VMS directory name.
  3934. mget /mlsd /match:* t*.h MLSD t*.h Contrary to the MLSD specification,
  3935. some MLSD-capable FTP servers do interpret wildcards. This form of the
  3936. MGET command can be used to force a wildcard to be sent to the server
  3937. for interpretation.
  3938. When MLSD is used implicitly (that is, without an /MLSD switch given to
  3939. force the use of MLSD) and an MGET command such as "mget foo/*.txt"
  3940. fails, Kermit automatically falls back to NLST and tries again.
  3941. 3.11.5. References
  3942. 1. Postel, J., and J. Reynolds, File Transfer Protocol (FTP), RFC 959,
  3943. October 1985: [372]ftp://ftp.isi.edu/in-notes/rfc959.txt.
  3944. 2. Hethmon, P, and R. Elz, Feature negotiation mechanism for the File
  3945. Transfer Protocol, RFC 2389, August 1998:
  3946. [373]ftp://ftp.isi.edu/in-notes/rfc2389.txt.
  3947. 3. Elz, R, and P. Hethmon, Extensions to FTP, Internet Draft
  3948. draft-ietf-ftpext-mlst-16.txt, September 2002:
  3949. [374]http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.
  3950. txt.
  3951. 4. [375]The Kermit FTP Client (overview).
  3952. [ [376]Top ] [ [377]FTP Top ] [ [378]C-Kermit Home ] [ [379]Kermit Home
  3953. ]
  3954. 4. FILE SCANNING
  3955. A new feature called file scanning is used in various contexts to
  3956. determine if a file is text or binary, and if it is text, what kind of
  3957. text. The overhead of file scanning is surprisingly tolerable, usually
  3958. about a quarter second per file. File scanning is now used instead of
  3959. filename patterns unless you SET FILE SCAN OFF, which restores the
  3960. previous behavior.
  3961. The primary benefit of file scanning is in file transfer. For all
  3962. practical purposes, now you can stop worrying about whether a file
  3963. should be sent in binary or text mode, or about sending mixtures of
  3964. text and binary files in a single operation, or configuring and
  3965. fine-tuning your lists of binary-file and text-file name patterns: now
  3966. it all just works.
  3967. File scanning is done by the file sender, which determines the type of
  3968. each file before it sends it and informs the receiver (Kermit or FTP
  3969. server) of the type. File scanning is NOT done by the receiver, because
  3970. it is the sender's responsibility to determine each file's type, send
  3971. the file in the right mode, and inform the receiver of the mode. If
  3972. both transfer partners are capable of this (or any other) form of
  3973. automatic text/binary mode switching, then files can be sent in both
  3974. directions with no worries about corruption due to inappropriate
  3975. transfer mode. (As noted in [380]Section 3, FTP servers don't do this,
  3976. so this discussion does not apply when using Kermit to download from an
  3977. FTP server.)
  3978. The rest of this section is mainly for the curious. If you don't read
  3979. it and simply accept all defaults, every file you send should go in the
  3980. appropriate mode automatically. As always, however, for character-set
  3981. translation to work for 7- and 8-bit character-set files, the
  3982. appropriate SET FILE CHARACTER-SET command(s) must have been executed
  3983. to identify their encoding (Kermit's default file character-set is
  3984. neutral ASCII except on platforms like HP-UX or DG/UX, where the
  3985. default file character-set is known). And of course, receiving is
  3986. another matter -- obviously the other Kermit must also send each file
  3987. in the appropriate mode.
  3988. Scanning is more reliable than filename patterns simply because
  3989. filenames are not reliable indicators of the file's contents. Classic
  3990. examples include ".doc" files, which are binary if Microsoft Word
  3991. documents but text on most other platforms, and ".com" files, which are
  3992. binary on DOS and Windows but text on VMS. Anyway, nobody knows the
  3993. naming conventions (if any) of all the applications (and persons!) on
  3994. your computer. Scanning, on the other hand, determines each file's type
  3995. by inspecting its contents rather than just looking at its name.
  3996. Also, file patterns -- even when they work as intended -- categorize
  3997. each file only as text or binary, whereas file scanning can make finer
  3998. distinctions:
  3999. BINARY
  4000. Binary data, not to be converted in any way. Examples include
  4001. binary machine code (executable programs), graphics images (GIF,
  4002. JPG, etc), compressed files (Z, GZ, etc), archives and packages
  4003. (ZIP, TAR, RPM, etc), object files and libraries (OBJ, DLL,
  4004. etc).
  4005. 7-BIT TEXT
  4006. Text encoded in a 7-bit character set such as ASCII or one of
  4007. the ISO 646 national versions. Kermit has no way to tell which
  4008. character is used, only that it's 7-bit text. Typical examples
  4009. include program source code, README files, Perl or Kermit
  4010. scripts, plain-text email, HTML, TeX, and various textual
  4011. encodings of binary files: Hex, Base64, etc. When sending such
  4012. files, the FILE DEFAULT 7BIT-CHARACTER-SET is used as the file
  4013. character-set, and then the appropriate transfer character set
  4014. is chosen from the associations list (ASSOCIATE, SHOW
  4015. ASSOCIATIONS).
  4016. 8-BIT TEXT
  4017. Text encoded in an 8-bit character set such as Latin-1, Latin-2,
  4018. Latin/Hebrew, Latin/Cyrillic, KOI8, HP-Roman8, JIS X 0208, Code
  4019. Page 437, or Code Page 1252. Again, Kermit has no way of knowing
  4020. which particular set is in use, only that it's 8-bit text. When
  4021. sending such files, the FILE DEFAULT 8BIT-CHARACTER-SET is used
  4022. as the file character-set, and then the appropriate transfer
  4023. character set is chosen from the associations list.
  4024. UCS2 TEXT
  4025. Unicode in its basic form, 16 bits (2 octets) per character.
  4026. When sending such files, UCS2 is the file character-set and the
  4027. byte order is identified automatically; the appropriate transfer
  4028. character set is chosen from the associations list. Normally
  4029. this would be UTF8. UTF-16 is not supported yet; Kermit's
  4030. Unicode translations are restricted to Plane 0, the Base
  4031. Multilingual Plane (BMP).
  4032. UTF8 TEXT
  4033. Unicode in its 8-bit transformation format. When sending such
  4034. files, UTF8 is the file character-set; the appropriate transfer
  4035. character set is chosen from the associations list, normally
  4036. UCS2 or UTF8.
  4037. File scanning is available in UNIX C-Kermit, in K-95, and to a limited
  4038. extent, in VMS C-Kermit (full scanning is problematic in VMS because
  4039. even plain-text files might contain binary record-format information).
  4040. The relevant commands are:
  4041. SET TRANSFER MODE { AUTOMATIC, MANUAL }
  4042. Tells whether the file-transfer mode (text or binary) should be
  4043. set by automatic or "manual" means. AUTOMATIC is the default,
  4044. which allows any of the automatic methods that are enabled to do
  4045. their jobs: FILE SCAN, FILE PATTERNS, peer recognition, etc.
  4046. MANUAL lets you control the transfer mode with the SET FILE TYPE
  4047. commands. As always, /TEXT and /BINARY switches on your
  4048. file-transfer commands override all other methods; if you give
  4049. one of these switches, scanning is not done. SHOW TRANSFER
  4050. displays the current TRANSFER MODE setting.
  4051. SET FILE SCAN { ON [ number ], OFF }
  4052. Turns this feature on and off. It's ON by default. When OFF, the
  4053. previous rules apply (SET FILE PATTERNS, etc). When ON is given,
  4054. you can also specify a number of bytes to be scanned. The
  4055. default is 49152 (= 48K). If a negative number is given, the
  4056. entire file is scanned, no matter how big, for maximum certainty
  4057. (for example, a PostScript file that appears to be plain text
  4058. might include an embedded graphic past the normal scanning
  4059. limit). SHOW FILE displays the current FILE SCAN setting.
  4060. SET FILE DEFAULT 7BIT-CHARACTER-SET name
  4061. Tells the 7-bit character-set to use if scanning identifies a
  4062. 7-bit text file, e.g. GERMAN. SHOW FILE displays the current SET
  4063. FILE DEFAULT settings. So does SHOW CHARACTER-SETS.
  4064. SET FILE DEFAULT 8BIT-CHARACTER-SET name
  4065. Tells the 8-bit character-set to use if scanning identifies an
  4066. 8-bit text file, e.g. LATIN1. SHOW FILE and SHOW CHARACTER-SET
  4067. display this.
  4068. ASSOCIATE FILE-CHARACTER-SET fcs tcs
  4069. When sending files and a file character-set (fcs) is identified
  4070. by scanning, this tells C-Kermit which transfer character-set
  4071. (tcs) to translate it to. It also allows C-Kermit to set the
  4072. appropriate transfer character-set automatically whenever you
  4073. give a SET FILE CHARACTER-SET command.
  4074. ASSOCIATE TRANSFER-CHARACTER-SET tcs fcs
  4075. When receiving files and a file arrives whose transfer
  4076. character-set (tcs) is announced by the sender, this command
  4077. tells C-Kermit which file character-set (fcs) to translate it
  4078. to. It also allows C-Kermit to set the appropriate file
  4079. character-set whenever you give a SET TRANSFER CHARACTER-SET
  4080. command.
  4081. SET FILE CHARACTER-SET name
  4082. When given for a 7-bit set, also sets FILE DEFAULT
  4083. 7BIT-CHARACTER-SET to the same set. When given for an 8-bit set,
  4084. also sets FILE DEFAULT 8BIT-CHARACTER-SET to the same set. If an
  4085. ASSOCIATE FILE-CHARACTER-SET command has been given for this
  4086. set, also sets the corresponding transfer character-set.
  4087. DIRECTORY /XFERMODE [ filespec ]
  4088. Performs a file scan of the given files, listing the result for
  4089. each file. If FILE SCAN is OFF but PATTERNS are ON, the result
  4090. shown according to the current FILE TEXT-PATTERNS and
  4091. BINARY-PATTERNS, and are restricted to (B) and (T). When FILE
  4092. SCAN is ON, the results are:
  4093. (B) Binary
  4094. (T)(7BIT) Text: 7-bit
  4095. (T)(8BIT) Text: 8-bit
  4096. (T)(UTF8) Text: Unicode UTF8
  4097. (T)(UCS2BE) Text: Unicode UCS2 Big Endian
  4098. (T)(UCS2LE) Text: Unicode UCS2 Little Endian
  4099. So you can use DIR /XFER to get a preview of how each file in a
  4100. selected group will be transferred. Everything to the right of
  4101. the (B) or (T) is new. If FILE SCAN is OFF, you only get the (B)
  4102. or (T) as before.
  4103. Note: Big and Little Endian refer to the ordering of bytes
  4104. within a computer word. Big Endian architecture is standard and
  4105. is used on most non-PC computers. Little Endian architecture is
  4106. used on PCs.
  4107. To illustrate file-transfer with scanning, suppose you have a directory
  4108. containing a mixture of text and binary files, and each text file can
  4109. be 7-bit German ISO 646, 8-bit Latin-1, or Unicode in any of the
  4110. following forms: UCS2 Little Endian, UCS2 Big Endian, or UTF8
  4111. ([381]UTF-16 is not supported yet). Assuming all the built-in defaults
  4112. are in effect, the following three commands do the job:
  4113. set file char german ; This sets the default for 7-bit text files
  4114. set file char latin1 ; This sets the default for 8-bit text files
  4115. send *
  4116. Each file is sent in the appropriate mode (text or binary), with text
  4117. files converted to the appropriate transfer character-set and labeled
  4118. so the receiver can convert them according to its own local
  4119. conventions.
  4120. By the way, what if you want to inhibit character-set translation but
  4121. still allow automatic text/binary mode switching? Previously, you could
  4122. simply SET TRANSFER CHARACTER-SET TRANSPARENT. But now with file
  4123. scanning, the file and transfer character-sets are set automatically
  4124. per file. A new command was added for this purpose:
  4125. SET TRANSFER TRANSLATION { ON, OFF }
  4126. Enables and disables file-transfer character-set translation. It
  4127. is enabled by default.
  4128. When TRANSFER TRANSLATION is OFF but FILE SCAN is ON, files are still
  4129. scanned to see if they are text or binary, but no character-set
  4130. translation is done when they text: only the normal record-format
  4131. conversion.
  4132. Like all SET commands, SET TRANSFER TRANSLATION is global and
  4133. persistent. You can also force a particular file-transfer command
  4134. (SEND, MSEND, GET, RECEIVE, TRANSMIT, etc) to not translate without
  4135. affecting the global translation settings by including the new
  4136. /TRANSPARENT switch, e.g.
  4137. send /transparent oofa.txt
  4138. As of C-Kermit 8.0.206, SET TRANSFER CHARACTER-SET TRANSPARENT implies
  4139. SET TRANSFER TRANSLATION OFF.
  4140. File scanning is also used in the TYPE command. The source file type
  4141. and character set are determined as above, and then the file is
  4142. automatically converted to your display character-set, line by line. In
  4143. Kermit 95, the display character-set is Unicode, perhaps converted to
  4144. your current console code page; in other versions of C-Kermit, it is
  4145. your current file character-set. Thus if you have the following set
  4146. appropriately:
  4147. SET FILE CHARACTER-SET (necessary in Unix but not K95)
  4148. SET FILE DEFAULT 7BIT CHARACTER-SET
  4149. SET FILE DEFAULT 8BIT CHARACTER-SET
  4150. then you should be able to TYPE any text file and see something
  4151. reasonable. For example, in Unix, if your DEFAULT 7BIT-CHARACTER-SET is
  4152. ITALIAN and your DEFAULT 8BIT-CHARACTER-SET is LATIN1, and your FILE
  4153. CHARACTER-SET is LATIN1, you can TYPE an Italian ISO 646 file, a
  4154. Latin-1 file, or any kind of Unicode file, and have it translated
  4155. automatically to Latin-1 for your display.
  4156. In the GUI version of Kermit 95, you can see mixtures of many different
  4157. scripts if the file is UTF8 or UCS2: Roman, Cyrillic, Hebrew, Greek,
  4158. Armenian, Georgian, etc, all on the same screen at once.
  4159. File scanning also adds a new criterion for file selection, i.e. to
  4160. select only text (or binary) files. Several commands now include a new
  4161. switch, /TYPE:{BINARY,TEXT,ALL}. BINARY means select only binary
  4162. regular files (not directories). TEXT means select only text files. ALL
  4163. means don't scan; select all files. Examples:
  4164. SEND /TYPE:BINARY *.*
  4165. Sends only binary files, skipping over text files.
  4166. NOTE: File scanning is NOT done when using external protocols (because
  4167. the external protocol programs, such as sz, are processing each file,
  4168. not Kermit).
  4169. DIRECTORY /TYPE:TEXT
  4170. Lists only text files but not binary files.
  4171. DELETE /TYPE:BINARY foo.*
  4172. Deletes all foo.* files that are regular binary files but does
  4173. not delete any text files.
  4174. CHMOD /TYPE:BINARY 775 *
  4175. (UNIX) Changes the permissions of all binary files to 775.
  4176. When FILE SCAN is OFF and FILE PATTERNS are ON, behavior is as before
  4177. with PATTERNS ON, but with some improvements:
  4178. * Pathnames are now stripped prior to pattern matching.
  4179. * Backup suffixes (like .~3~) are stripped prior to pattern matching.
  4180. [ [382]Top ] [ [383]Contents ] [ [384]C-Kermit Home ] [ [385]Kermit
  4181. Home ]
  4182. 5. FILE AND DIRECTORY NAMES CONTAINING SPACES
  4183. Prior to the introduction of the graphical user interface (GUI), it was
  4184. inconceivable that file or directory names could contain spaces,
  4185. because space is a field delimiter in all command languages. GUIs,
  4186. however, use dialog boxes for filenames, so there is never any question
  4187. of distinguishing a filename from adjacent fields -- because there are
  4188. no adjacent fields -- and therefore it has become quite common on
  4189. computers that have GUIs to have file and directory names composed of
  4190. multiple words. Of course this poses problems for command shells and
  4191. other text-oriented programs.
  4192. Most command shells address these problems by allowing such names to be
  4193. enclosed in doublequotes, e.g.:
  4194. cd "c:\Program Files"
  4195. C-Kermit previously used braces for this:
  4196. cd {c:\Program Files}
  4197. which was not what most people expected. And even when braces were
  4198. used, Kermit had difficulties with completion, file menus, and so
  4199. forth, within braced fields.
  4200. C-Kermit 8.0 allows either doublequotes or braces to be used for
  4201. grouping:
  4202. send "this file"
  4203. send {this file}
  4204. rename "this file" "that file"
  4205. rename {this file} "that file"
  4206. rename "this file" {that file}
  4207. cd {Program Files}
  4208. cd "Program Files"
  4209. Note that the doublequotes or brackets must enclose the whole file or
  4210. directory specification:
  4211. "c:\My Directory"
  4212. not:
  4213. c:\"My Directory"
  4214. In C-Kermit 8.0, you can also use completion on these filenames, in
  4215. which case Kermit supplies the quotes (or braces) automatically.
  4216. Example (in which the current directory contains only one file whose
  4217. name starts with "th" and its full name is "this file" (without the
  4218. quotes, but with the space)):
  4219. cat th<Tab>
  4220. Kermit repaints the filename field like this:
  4221. cat "this file"
  4222. That is, it backspaces over the original "th" and then writes the
  4223. filename in doublequotes.
  4224. If completion is only partial, Kermit still supplies the quotes, but in
  4225. this case also beeps. To continue the filename, you must first
  4226. backspace over the closing quote. The closing quote is supplied in this
  4227. case to make sure that you can see the spaces, especially if they are
  4228. trailing. For example, if the current directory contains two files
  4229. whose names start with "th", and their fill names are "this file" and
  4230. "this other file":
  4231. cat th<Tab>
  4232. Kermit prints:
  4233. cat "this "<Beep>
  4234. If it didn't print the closing quote, you would probably wonder why it
  4235. was beeping.
  4236. Also, if you begin a filename field with a doublequote or opening
  4237. brace, now you can use completion or get ?-help; this was never
  4238. possible before.
  4239. C-Kermit>type "thi? Input file specification, one of the following:
  4240. this file this other file
  4241. C-Kermit>type "thi_
  4242. [ [386]Top ] [ [387]Contents ] [ [388]C-Kermit Home ] [ [389]Kermit
  4243. Home ]
  4244. 6. OTHER COMMAND PARSING IMPROVEMENTS
  4245. 6.1. Grouping Macro Arguments
  4246. Doublequotes now can be used in macro invocations to group arguments
  4247. containing spaces, where previously only braces could be used:
  4248. define xx show args
  4249. xx one "this is two" three
  4250. Result:
  4251. Macro arguments at level 0 (\v(argc) = 4):
  4252. \%0 = xx
  4253. \%1 = one
  4254. \%2 = this is two
  4255. \%3 = three
  4256. Also, you can now quote braces and quotes in macro args (this didn't
  4257. work before). Examples:
  4258. xx "{" ; The argument is a single left brace
  4259. xx {"} ; The argument is a doublequote character
  4260. In case this new behavior interferes with your scripts, you can restore
  4261. the previous behavior with:
  4262. SET COMMAND DOUBLEQUOTING OFF
  4263. 6.2. Directory and File Name Completion
  4264. C-Kermit 8.0 also includes better completion for directory names, e.g.
  4265. in the CD command. If the name typed so far uniquely matches a
  4266. directory name, it is completed (as before), but now if the directory
  4267. contains any subdirectories, completion is partial (allowing you to
  4268. supply additional path segments without backspacing); otherwise it is
  4269. complete.
  4270. Completion has also been improved for file and directory names that
  4271. contain not only spaces (as described above) but also "metacharacters"
  4272. such as asterisk (*) and tilde (~): now the field is repainted if
  4273. necessary. For example, if the current directory contains only one file
  4274. whose name contains "blah", then in:
  4275. type *blah<Tab>
  4276. "*blah" is replaced by the filename. In earlier releases, the part
  4277. typed so far was left on the command line (and in the history buffer),
  4278. so even when the original command worked, the recalled version would
  4279. not. Similarly for ~ (the nearly-universal Unix notation for username):
  4280. type ~olga/x<Tab>
  4281. is repainted as (e.g.):
  4282. type /users/home/olga/x(Beep)
  4283. Speaking of command history, the new SHOW HISTORY command shows your
  4284. command history and recall buffer. SAVE COMMAND HISTORY saves it into a
  4285. file of your choice.
  4286. 6.3. Passing Arguments to Command Files
  4287. The method for passing arguments to command files has been improved.
  4288. Prior to C-Kermit 7.0 there was no provision for doing this. In
  4289. C-Kermit 7.0, the TAKE command was changed to allow arguments to be
  4290. given after the filename:
  4291. take commandfile arg1 arg2 ...
  4292. This was accomplished by replacing the current \%1, \%2, etc, with the
  4293. given arguments, since a new set of macro argument variables is created
  4294. only when a macro is executed, not a command file. It is much more
  4295. intuitive, however, if arguments to command files worked like those to
  4296. macros: the command file sees the arguments as its own \%1, \%2, etc,
  4297. but the caller's variables are not disturbed. C-Kermit 8.0 accomplishes
  4298. this by automatically creating an intermediate temporary macro to start
  4299. the command file (if any arguments were given), thus creating a new
  4300. level of arguments as expected.
  4301. 6.4. More-Prompting
  4302. The familiar --more?-- prompt that appears at the end of each screenful
  4303. of command-response output now accepts a new answer: G (Go) meaning
  4304. "show all the rest without pausing and asking me any more questions". P
  4305. (Proceed) is a synonym for G.
  4306. 6.5. Commas in Macro Definitions
  4307. As noted in the [390]C-Kermit manual, comma is used to separate
  4308. commands in a macro definition. Even when the macro is defined on
  4309. multiple lines using curly-brace block-structure notation without
  4310. commas, the definition is still stored internally as a comma-separated
  4311. list of commands. Therefore special tricks are needed to include a
  4312. comma in a command. The classic example is:
  4313. define foo {
  4314. (some command)
  4315. if fail echo Sorry, blah failed...
  4316. }
  4317. This would result in Kermit trying to execute a "blah" command. This
  4318. could always be handled by enclosing the text in braces:
  4319. define foo {
  4320. (some command)
  4321. if fail echo {Sorry, blah failed...}
  4322. }
  4323. but doublequotes (more intuitive) should have worked too. Now they do:
  4324. define foo {
  4325. (some command)
  4326. if fail echo "Sorry, blah failed..."
  4327. }
  4328. 6.6. Arrow Keys
  4329. As of version 8.0.201, C-Kermit on most platforms lets you access the
  4330. command history buffer with arrow keys, just as you always could with
  4331. control characters. The restrictions are:
  4332. 1. Only Up and Down arrow keys are accepted.
  4333. 2. Only 7-bit ANSI arrow-key sequences are understood (ESC followed by
  4334. [ or uppercase letter O, followed by uppercase letter A or (up) B
  4335. (down).
  4336. This change was made to facilitate command recall in Linux-based PDAs
  4337. that don't have a Control key, or at least not one that's easily (or
  4338. always) accessible, such as the Sharp Zaurus SL5500.
  4339. [ [391]Top ] [ [392]Contents ] [ [393]C-Kermit Home ] [ [394]Kermit
  4340. Home ]
  4341. 7. NEW COMMANDS AND SWITCHES
  4342. See [395]Section 4 for more about file scanning and the /TYPE: switch.
  4343. ASK[Q] [ /TIMEOUT:number /QUIET /DEFAULT:text ] variable [ prompt ]
  4344. The new optional /TIMEOUT: switch for ASK and ASKQ causes the
  4345. command to time out and and fail if no response is given within
  4346. the specified number of seconds, 1 or greater (0 or less means
  4347. no timeout, wait forever). This works just like SET ASK-TIMER,
  4348. except its effect is local to the ASK command with which it is
  4349. given and it does not disturb the global ask timer setting. The
  4350. new /QUIET switch tells Kermit not to print an error message if
  4351. the ASK or ASKQ command times out waiting for a response.
  4352. Version 8.0.211 adds the /DEFAULT:text switch for ASK-Class
  4353. commands (ASK, ASKQ, and GETOK). This lets you supply a default
  4354. answer in case the user supplies an empty answer or the
  4355. /TIMEOUT: switch was included and the time limit expired without
  4356. an answer. In both these cases, the command succeeds.
  4357. CAT filename
  4358. Equivalent to TYPE /NOPAGE.
  4359. CDUP
  4360. Changes Kermit's local working directory to the parent of the
  4361. current one. Equivalent to "cd .." in UNIX or Windows, "cd [-]"
  4362. in VMS, "cd ^" in AOS/VS, etc; in other words, it's a
  4363. platform-independent way of moving one level up in a directory
  4364. tree.
  4365. CHMOD [ switches ] permission files
  4366. UNIX only. Sets file permissions for one or more files or
  4367. directories. The permission must be given as an octal number,
  4368. e.g. 664, 755. Switches: /DIRECTORIES, /FILES, /NOLIST, /PAGE,
  4369. /DOTFILES, /LIST, /NOPAGE, /RECURSIVE, /TYPE:{TEXT,BINARY,ALL},
  4370. /SIMULATE. The /TYPE: switch allows selection of only text or
  4371. binary files. For example, if you have a mixture of source files
  4372. and executables, you can use "chmod /files /type:text 664" to
  4373. give owner/group read/write and world read permission to the
  4374. text files, and "chmod /files /type:binary 775" to give the same
  4375. plus execute permission to the executables. Use /SIMULATE to see
  4376. which files would be affected, without actually changing their
  4377. permissions.
  4378. CLEAR KEYBOARD-BUFFER
  4379. Flushes any as-yet unread characters from the keyboard input
  4380. buffer. Useful for flushing typeahead in scripts.
  4381. CONTINUE
  4382. When given at an interactive command prompt that was reached by
  4383. issuing a PROMPT command (described in this section) from a
  4384. script, this command returns to the script, continuing its
  4385. execution at the command after the PROMPT command. In this
  4386. context, CONTINUE is simply a more-intuitive synonym for END.
  4387. COPY, RENAME, and TRANSLATE
  4388. These commands now work on file groups if the target filename is
  4389. a directory, e.g. "copy oofa.* ..", "rename * ~olga/tmp/"
  4390. COPY /APPEND source destination
  4391. The source file specification can now include wildcards, in
  4392. which case all of the source files that match will go into the
  4393. destination file in alphabetical order by name.
  4394. DELETE /ASK
  4395. Asks permission to delete each file before deleting it. In
  4396. C-Kermit 7.0, the answers were "yes" (or "ok") and "no".
  4397. C-Kermit 8.0 adds "go" (meaning, delete all the rest without
  4398. asking) and "quit" (cancel the DELETE command and return to the
  4399. prompt).
  4400. DELETE /DIRECTORIES
  4401. Deletes not only files but also directories.
  4402. DELETE /RECURSIVE
  4403. Deletes all files that match the given file specification in the
  4404. current (or given) directory and all directories beneath it.
  4405. DELETE /SUMMARY
  4406. Prints only the number of files deleted and total size freed,
  4407. without listing each file.
  4408. DELETE /TREE
  4409. Shorthand for DELETE /RECURSIVE /DIRECTORIES /DOTFILES/.
  4410. Equivalent to Windows DELTREE or Unix "rm -Rf". If no file
  4411. specification is given, the contents of the current directory,
  4412. plus all of its subdirectories and their contents, are deleted.
  4413. DELETE /TYPE:BINARY
  4414. Delete only regular binary files (requires FILE SCAN ON).
  4415. DELETE /TYPE:TEXT
  4416. Delete only regular text files (requires FILE SCAN ON).
  4417. DIRECTORY [ switches ] [ filespec [ filespec [ filespec ... ] ] ]
  4418. The DIRECTORY command now accepts more than one file
  4419. specification; e.g. "directory moon.txt sun.doc stars.*".
  4420. DIRECTORY /NORECURSIVE xxx
  4421. If xxx is a directory name, forces listing of the directory
  4422. itself rather than its contents.
  4423. DIRECTORY /FOLLOWLINKS xxx
  4424. (UNIX only) Tells the DIRECTORY command to follow symbolic
  4425. links. This not the default because it can cause endless loops.
  4426. DIRECTORY /NOFOLLOWLINKS xxx
  4427. (UNIX only) Tells the DIRECTORY command not to follow symbolic
  4428. links, but rather, merely to list them. This is the default.
  4429. DIRECTORY /OUTPUT:filename
  4430. Sends the results of the DIRECTORY command to the given file.
  4431. DIRECTORY /SUMMARY
  4432. Prints only the number of directories and files and the total
  4433. size, without listing each file.
  4434. DIRECTORY /TYPE:{TEXT,BINARY}
  4435. Shows only files of the selected type, based on file scan.
  4436. DIRECTORY /XFERMODE
  4437. Now shows results of file scan (see [396]Section 4).
  4438. FOPEN [ switches ] channel filename
  4439. As of version 8.0.211, FOPEN allows /dev/tty as a filename in
  4440. Unix-based operating systems.
  4441. FREAD /TRIM
  4442. (8.0.211) Trims any trailing blanks or tabs from the item (such
  4443. as a line of text) that it has read.
  4444. FREAD /UNTABIFY
  4445. (8.0.211) Converts Horizontal Tab characters to the appropriate
  4446. number of spaces, based on VT100-like tab stops (1,9,17,25,...).
  4447. GREP [ switches ] pattern files
  4448. Similar to Unix grep command: displays file lines that match the
  4449. given [397]pattern. Switches:
  4450. /COUNT[:variable]
  4451. Don't show the matching lines, just tell how many lines
  4452. match. If a variable name is specified, the count is
  4453. stored in the given variable.
  4454. /DOTFILES
  4455. Include files whose names begin with dot.
  4456. /LINENUMBERS
  4457. Show line numbers of matching lines.
  4458. /NAMEONLY
  4459. only list the names of files that contain matching lines,
  4460. but not the lines themselves.
  4461. /NOBACKUP
  4462. Skip backup files.
  4463. /NOCASE
  4464. Ignore alphabetic case while pattern matching.
  4465. /NODOTFILES
  4466. skip files whose names start with dot (period).
  4467. /NOLIST
  4468. Suppress output but set SUCCESS or FAILURE according to
  4469. search result.
  4470. /NOMATCH
  4471. Look for lines that do not match the pattern.
  4472. /NOPAGE
  4473. Don't pause between screens of output.
  4474. /OUTPUT:filename
  4475. Write results into the given file.
  4476. /PAGE
  4477. Pause between screens of output.
  4478. /RECURSIVE
  4479. Search files in subdirectories too.
  4480. /TYPE:{TEXT,BINARY}
  4481. Search only files of the specified type.
  4482. Synonyms: FIND, SEARCH.
  4483. GETOK /TIMEOUT:n /QUIET /DEFAULT:text
  4484. The new /QUIET switch instructs GETOK, when given a timeout, not
  4485. to print an error message if it times out. As of 8.0.211, a
  4486. default answer can be supplied (see ASK).
  4487. HEAD [ switches ] filename
  4488. Equivalent to TYPE /HEAD [ other-switches ] filename.
  4489. HELP DATE
  4490. Explains date-time formats, including timezone notation and
  4491. delta times.
  4492. HELP FIREWALLS
  4493. Explains the firewall negotiation capabilities of your version
  4494. of Kermit.
  4495. KCD [ symbolic-directory-name ]
  4496. Changes Kermit's working directory to the named symbolic
  4497. directory, such as such as exedir, inidir, startup, download, or
  4498. and home. Type "kcd ?" for a list of symbolic directory names
  4499. known to your copy of Kermit, or give the new ORIENTATION
  4500. command for a more detailed explanation. If you give a KCD
  4501. command without a directory name, Kermit returns to its "home"
  4502. directory, which is determined in some way that depends on the
  4503. underlying operating system, but which you can redefine with the
  4504. (new) SET CD HOME command. Your home directory is shown by SHOW
  4505. CD and it's also the value of the \v(home) variable.
  4506. LICENSE
  4507. Displays the C-Kermit license.
  4508. L-commands
  4509. When Kermit has a connection to a Kermit or FTP server, file
  4510. management commands such as CD, DIRECTORY, and DELETE might be
  4511. intended for the local computer or the remote server. C-Kermit
  4512. 8.0.200 and earlier always executes these commands on the local
  4513. computer. If you want them executed by the remote server, you
  4514. have to prefix them with REMOTE (e.g. REMOTE CD) or use special
  4515. R-command aliases (e.g. RCD = REMOTE CD, RDIR = REMOTE DIR,
  4516. etc). But this feels unnatural to FTP users, who expect
  4517. unprefixed file management commands to be executed by the remote
  4518. server, rather than locally. C-Kermit 8.0.201 adds automatic
  4519. locus switching to present an FTP-like interface for FTP
  4520. connections and the normal Kermit interface for Kermit
  4521. connections, and a SET LOCUS command (described below) to
  4522. control whether or how this is done. For when LOCUS is REMOTE, a
  4523. new set of commands was added for local management: LCD (Local
  4524. CD), LDIR (Local DIR), etc. These are described below under SET
  4525. LOCUS.
  4526. MORE filename
  4527. Equivalent to TYPE /PAGE.
  4528. ORIENTATION
  4529. Displays symbolic directory names and the corresponding variable
  4530. names and values. The symbolic names, such as exedir, inidir,
  4531. startup, download, and home, can be used as arguments to the new
  4532. KCD command.
  4533. PROMPT [ text ]
  4534. For use in a macro or command file: enters interactive command
  4535. mode within the current context ([398]Section 8.1). If the
  4536. optional text is included, the prompt is set to it. The text can
  4537. include variables, functions, etc, as in the SET PROMPT command.
  4538. They are evaluated each time the prompt is printed. Unlike the
  4539. SET PROMPT command, the text argument applies only to the
  4540. current command level. Thus you can have different prompts at
  4541. different levels.
  4542. REMOTE SET MATCH { DOTFILE, FIFO } { ON, OFF }
  4543. Allows the client to tell the server whether wildcards sent to
  4544. the server should match dot files (files whose names begin with
  4545. period) or FIFOs (named pipes). See SET MATCH.
  4546. SET ATTRIBUTE RECORD-FORMAT { ON, OFF }
  4547. Allows control of the Kermit's Record-Format attribute. Set this
  4548. to OFF in case incoming file are refused due to unknown or
  4549. invalid record formats if you want to accept the file anyway
  4550. (and, perhaps, postprocess it to fix its record format).
  4551. SET CD HOME [ directory ]
  4552. Specifies the target directory for the CD and KCD commands, when
  4553. they are given without an argument, and also sets the value of
  4554. the \v(home) variable.
  4555. SET EXIT HANGUP { OFF, ON }
  4556. Normally ON, meaning that when Kermit exits, it also explicitly
  4557. hangs up the current SET LINE / SET PORT serial port according
  4558. to the current SET MODEM TYPE and SET MODEM HANGUP METHOD, and
  4559. closes the port device if it was opened by Kermit in the first
  4560. place (as opposed to inherited). SET EXIT HANGUP OFF tells
  4561. Kermit not to do this. This can't prevent the operating system
  4562. from closing the device when Kermit exits (and it's a "last
  4563. close") but if the port or modem have been conditioned to
  4564. somehow ignore the close and keep the connection open, at least
  4565. Kermit itself won't do anything explicit to hang it up or close
  4566. it.
  4567. SET FILE EOF { CTRL-Z, LENGTH }
  4568. Specifies the end-of-file detection method to be used by
  4569. C-Kermit when sending and receiving text files, and in the TYPE
  4570. and similar text-file oriented commands. The normal and default
  4571. method is LENGTH. You can specify CTRL-Z when handling CP/M or
  4572. MS-DOS format text files, in which a Ctrl-Z (ASCII 26) character
  4573. within the file marks the end of the file.
  4574. SET FILE LISTSIZE number
  4575. Allocates space for the given number of filenames to be filled
  4576. in by the wildcard expander. The current number is shown by SHOW
  4577. FILE. If you give a command that includes a filename containing
  4578. a wildcard (such as "*") that matches more files that Kermit's
  4579. list has room for, you can adjust the list size with this
  4580. command.
  4581. SET FILE STRINGSPACE number
  4582. Allocates space for the given amount of filename strings for use
  4583. by the wildcard expander. The current number is shown by SHOW
  4584. FILE. The number is the total number of bytes of all the file
  4585. specifications that match the given wildcard.
  4586. If you need to process a bigger list of files than your computer has
  4587. memory for, you might be able use an external file list. The Kermit
  4588. SEND and the FTP PUT and GET commands accept a /LISTFILE: switch,
  4589. which gives the name of a file that contains the list of files to be
  4590. transferred. Example for UNIX:
  4591. !find . -print | grep / > /tmp/names
  4592. ftp put /update /recursive /listfile:/tmp/names
  4593. SET LOCUS { AUTO, LOCAL, REMOTE }
  4594. Added in C-Kermit 8.0.201. Sets the locus for unprefixed file
  4595. management commands such as CD, DIRECTORY, MKDIR, etc. When
  4596. LOCUS is LOCAL these commands act locally and a REMOTE (or R)
  4597. prefix (e.g. REMOTE CD, RCD, RDIR) is required to send file
  4598. management commands to a remote server. When LOCUS is REMOTE, an
  4599. L prefix is required to issue local file management commands
  4600. (e.g. LCD, LDIR). The word LOCAL can't be used as a prefix since
  4601. it is already used for declaring local variables. LOCUS applies
  4602. to all types of connections, and thus is orthogonal to SET
  4603. GET-PUT-REMOTE, which selects between Kermit and FTP for remote
  4604. file-transfer and management commands. The default LOCUS is
  4605. AUTO, which means we switch to REMOTE whenever an FTP connection
  4606. is made, and to LOCAL whenever a non-FTP connection is made, and
  4607. switch back accordingly whenever a connection is closed. So by
  4608. default, Kermit behaves in its traditional manner unless you
  4609. make an FTP connection, in which case it acts like a regular FTP
  4610. client (but better :-) LOCUS applies to the following
  4611. commands:
  4612. Unprefixed Remote Local Description
  4613. CD (CWD) RCD LCD Change (Working) Directory
  4614. CDUP RCDUP LCDUP CD Up
  4615. PWD RPWD LPWD Print Working Directory
  4616. DIRECTORY RDIR LDIR Request a directory listing
  4617. DELETE RDEL LDEL Delete (a) file(s)
  4618. RENAME RREN LREN Rename a file
  4619. MKDIR RMKDIR LMKDIR Create a directory
  4620. RMDIR RRMDIR LRMDIR Remove a directory
  4621. SET MATCH { DOTFILE, FIFO } { ON, OFF }
  4622. Whether C-Kermit filename patterns (wildcards) should match
  4623. filenames that start with dot (period), or (Unix only) FIFOs
  4624. (named pipes). The defaults are to skip dotfiles in Unix but
  4625. match them elsewhere, and to skip FIFOs. Applies to both
  4626. interactive use and to server mode, when the server receives
  4627. wildcards, e.g. in a GET command. Also see REMOTE SET MATCH.
  4628. SET OPTIONS DIRECTORY /DOTFILES
  4629. Now works for server listings too (UNIX only). Give this command
  4630. prior to having Kermit enter server mode, and then it will show
  4631. files whose names begin with dot (period) when sent a REMOTE
  4632. DIRECTORY command.
  4633. SET QUIET ON
  4634. (as well as the -q command-line option) Now applies also to:
  4635. + SET HOST connection progress messages.
  4636. + "Press the X or E key to cancel" file-transfer message.
  4637. + REMOTE CD response.
  4638. + REMOTE LOGIN response.
  4639. SET RECEIVE PERMISSIONS { ON, OFF }
  4640. Tells C-Kermit whether to set the permissions of incoming files
  4641. (received with Kermit protocol) from the permissions supplied in
  4642. the file's Attribute packet (if any). Normally ON. Also see SET
  4643. SEND PERMISSIONS.
  4644. SET ROOT directory
  4645. Like UNIX chroot, without requiring privilege. Sets the root for
  4646. file access, does not allow reference to or creation of files
  4647. outside the root, and can't be undone.
  4648. SET SEND PERMISSIONS { ON, OFF }
  4649. Tells C-Kermit whether to include file permissions in the
  4650. attributes it includes with each file when sending with Kermit
  4651. protocol. Also see SET RECEIVE PERMISSIONS.
  4652. SET TCP { HTTP-PROXY, SOCKS-SERVER } /USER:name /PASSWORD:text
  4653. These commands now allow specification of username and password.
  4654. SET TERMINAL . . .
  4655. (See [399]Section 12.)
  4656. SET TRANSFER MESSAGE [ text ]
  4657. Sets an initial text message to be displayed in the
  4658. file-transfer display. The transfer message is automatically
  4659. deleted once used, so must be set each time a message a desired.
  4660. Any variables in the message are evaluated at the time the SET
  4661. command is given. If the optional text is omitted, any transfer
  4662. message that is currently set is removed. Synonym: SET XFER MSG.
  4663. SHOW TRANSFER displays it if it has been set but not yet used.
  4664. SHOW COMMUNICATIONS
  4665. In C-Kermit 8.0, SHOW COMMUNICATIONS, when given in remote mode
  4666. (i.e. before any connection has been established), tells the
  4667. typical dialout device name for the particular platform on which
  4668. it's running (e.g. TXA0: for VMS, or /dev/cua0p0 for HP-UX). On
  4669. Unix platforms, it also tells the name of the lockfile
  4670. directory. This way, you have an idea of what the SET LINE
  4671. device name should look like, and if the SET LINE command fails,
  4672. you know the name of the directory or device that is protected
  4673. against you.
  4674. SHOW VARIABLES [ name [ name [ ... ] ] ]
  4675. In C-Kermit 8.0.201 you can request values of a list of built-in
  4676. (\v(xxx)) variables. Each name is a pattern, as before, but now
  4677. it a free pattern rather than an anchored one (explained in
  4678. [400]Section 8.12) so now "show var date time" shows the values
  4679. of all variables whose names include the strings "date" or
  4680. "time".
  4681. TAIL [ switches ] filename
  4682. Equivalent to TYPE /TAIL [ other-switches ] filename.
  4683. TRANSMIT /NOECHO [ other switches ] filename
  4684. The /NOECHO switch is equivalent to giving the command SET
  4685. TRANSMIT ECHO OFF prior to the TRANSMIT command, except the
  4686. switch affects only the command with which it was given and does
  4687. not affect the prevailing global setting.
  4688. TRANSMIT /NOWAIT [ other switches ] filename
  4689. The /NOWAIT switch is equivalent to giving the command SET
  4690. TRANSMIT PROMPT 0 prior to the TRANSMIT command, except the
  4691. switch affects only the command with which it was given and does
  4692. not affect the prevailing global setting.
  4693. TRANSMIT /NOWAIT /NOECHO /BINARY [ other switches ] filename
  4694. When the TRANSMIT command is given with the /NOWAIT, /NOECHO,
  4695. and /BINARY switches, this activates a special "blast the whole
  4696. file out the communications connection all at once" mode that
  4697. Kermit didn't have prior to version 8.0. There has been
  4698. increasing demand for this type of transmission with the advent
  4699. of devices that expect image (e.g. .JPG) or sound (e.g. .MP3)
  4700. files as raw input. The obvious question is: how does the
  4701. receiving device know when it has the whole file? This depends
  4702. on the device, of course; usually after a certain amount of time
  4703. elapses with nothing arriving, or else when Kermit hangs up or
  4704. closes the connection.
  4705. TYPE /CHARACTER-SET:name
  4706. Allows you to specify the character set in which the file to be
  4707. typed is encoded.
  4708. TYPE /NUMBER
  4709. Adds line numbers.
  4710. TYPE /OUTPUT:filename
  4711. Sends the results of the TYPE command to the given file.
  4712. TYPE /TRANSLATE-TO:name
  4713. Used in conjunction with TYPE /CHARACTER-SET:xxx; allows you to
  4714. specify the character set in which the file is to be displayed.
  4715. TYPE /TRANSPARENT
  4716. Used to disable character-set translation in the TYPE command,
  4717. which otherwise can take place automatically based on file
  4718. scanning, even when /CHARACTER-SET and /TRANSLATE-TO switches
  4719. are not given.
  4720. VOID text
  4721. Parses the text, evaluating any backslash items in it (such as
  4722. function calls) but doesn't do anything further, except possibly
  4723. printing error messages. Useful for invoking functions that have
  4724. side effects without using or printing their direct results,
  4725. e.g. "void \fsplit(\%a,&a)".
  4726. Symbolic Links in UNIX
  4727. The UNIX versions of C-Kermit have had /FOLLOWLINKS and /NOFOLLOWLINKS
  4728. switches added to several commands to control the treatment of symbolic
  4729. links. Different commands deal differently with symbolic links:
  4730. Kermit SEND, FTP MPUT
  4731. /NOFOLLOWLINKS is the default, which means symbolic links are
  4732. skipped entirely. The alternative, /FOLLOWLINKS, should be used
  4733. with caution, since an innocent link might point to a whole file
  4734. system, or it might cause a loop. There is no way in Kermit or
  4735. FTP protocol to send the link itself. We either skip them or
  4736. follow them; we can't duplicate them.
  4737. DIRECTORY
  4738. /NOFOLLOWLINKS is the default, which means the DIRECTORY command
  4739. lists symbolic links in a way that shows they are links, but it
  4740. does not follow them. The alternative, /FOLLOWLINKS, follows
  4741. links and gives information about the linked-to directories and
  4742. files.
  4743. DELETE, RMDIR
  4744. The DELETE command does not have link-specific switches. DELETE
  4745. never follows links. If you tell Kermit to delete a symbolic
  4746. link, it deletes the link itself, not the linked-to file. Ditto
  4747. for RMDIR.
  4748. COPY
  4749. The COPY command behaves just like the UNIX cp command; it
  4750. always follows links.
  4751. RENAME
  4752. The RENAME command behaves just like the UNIX mv command; it
  4753. operates on links directly rather than following.
  4754. [ [401]Top ] [ [402]Contents ] [ [403]C-Kermit Home ] [ [404]Kermit
  4755. Home ]
  4756. 8. OTHER SCRIPTING IMPROVEMENTS
  4757. 8.1. Performance and Debugging
  4758. A command cache for frequently used commands plus some related
  4759. optimizations increases the speed of compute-bound scripts by anywhere
  4760. from 50% to 1000%.
  4761. The new PROMPT command can be used to set breakpoints for debugging
  4762. scripts. If executed in a command file or macro, it gives you an
  4763. interactive command prompt in the current context of the script, with
  4764. all its variables, arguments, command stack, etc, available for
  4765. examination or change, and the ability to resume the script at any
  4766. point (END resumes it, Ctrl-C or STOP cancels it and returns to top
  4767. level).
  4768. The new Ctrl-C trapping feature ([405]Section 8.14) lets you intercept
  4769. interruption of scripts. This can be used in combination with the
  4770. PROMPT command to debug scripts. Example:
  4771. define ON_CTRLC {
  4772. echo INTERRUPTED BY CTRL-C...
  4773. echo The command stack has not yet been rolled back:
  4774. show stack
  4775. echo Type Ctrl-C again or use the END command to return to top level.
  4776. prompt Debug>
  4777. }
  4778. Adding this ON_CTRL definition to your script lets you interrupt it at
  4779. any point and get prompt that is issued at the current command level,
  4780. so you can query local variables, etc.
  4781. [ [406]Top ] [ [407]Contents ] [ [408]C-Kermit Home ] [ [409]Kermit
  4782. Home ]
  4783. 8.2. Using Macros as Numeric Variables
  4784. A macro is a way to assign a value to a name, and then use the name to
  4785. refer to the value. Macros are used in two ways in Kermit: as
  4786. "subroutines" or functions composed of Kermit commands, which are
  4787. executed, or as variables to hold arbitrary values -- text, numbers,
  4788. filenames, etc.
  4789. When a macro is to be executed, its name is given as if it were a
  4790. C-Kermit command, optionally preceded by the word "do". When a macro is
  4791. used as a variable, it must be "escaped" with \m(xxx) (or equivalent
  4792. function, e.g. \s(xxx), \:(xxx), \fdefinition(xxx)), where xxx is the
  4793. macro name, for example:
  4794. define filename /usr/olga/oofa.txt
  4795. send \m(filename)
  4796. Of course variables can also hold numbers:
  4797. define size 17
  4798. declare \&a[\m(size)]
  4799. ...
  4800. define index 3
  4801. if ( == \m(index) 3 ) echo The third value is: \&a[\m(index)]
  4802. evaluate index (\m(index) * 4)
  4803. if ( > \m(index) \m(size) ) echo Out of range!
  4804. But these are contexts in which only numbers are valid. C-Kermit 8.0
  4805. has been changed to treat non-escaped non-numeric items in strictly
  4806. numeric contexts as macro names. So it is now possible (but not
  4807. required) to omit the \m(...) notation and just use the macro name in
  4808. these contexts:
  4809. define size 17
  4810. declare \&a[size]
  4811. ...
  4812. define index 3
  4813. if ( == index 3 ) echo The third value is: \&a[index]
  4814. evaluate index (index * 4)
  4815. if ( > index size ) echo Out of range!
  4816. This is especially nice for loops that deal with arrays. Here, for
  4817. example, is a loop that reverses the order of the elements in an array.
  4818. Whereas formerly it was necessary to write:
  4819. .\%n ::= \fdim(&a)
  4820. for \%i 1 \%n/2 1 {
  4821. .tmp := \&a[\%n-\%i+1]
  4822. .\&a[\%n-\%i+1] := \&a[\%i]
  4823. .\&a[\%i] := \m(tmp)
  4824. }
  4825. Recoding this to use macro names "i" and "n" instead of the backslash
  4826. variables \%i and \%n, we have:
  4827. .n ::= \fdim(&a)
  4828. for i 1 n/2 1 {
  4829. .tmp := \&a[n-i+1]
  4830. .\&a[n-i+1] := \&a[i]
  4831. .\&a[i] := \m(tmp)
  4832. }
  4833. which reduces the backslash count to less than half. The final
  4834. statement in the loop could be written ".\&a[i] ::= tmp" if the array
  4835. contained only numbers (since ::= indicates arithmetic expression
  4836. evaluation).
  4837. Also, now you can use floating-point numbers in integer contexts (such
  4838. as array subscripts), in which case they are truncated to an integer
  4839. value (i.e. the fractional part is discarded).
  4840. Examples of numeric contexts include:
  4841. * Array subscripts.
  4842. * Any numeric function argument.
  4843. * Right-hand side of ::= assignments.
  4844. * EVALUATE command or \fevaluate() function expression.
  4845. * The INCREMENT or DECREMENT by-value.
  4846. * IF =, >, <, !=, >=, and <= comparands.
  4847. * The IF number construct.
  4848. * FOR-loop variables.
  4849. * STOP, END, and EXIT status codes.
  4850. * The INPUT timeout value.
  4851. * PAUSE, WAIT, SLEEP, MSLEEP intervals.
  4852. * The SHIFT argument.
  4853. * Numeric switch arguments, e.g. TYPE /WIDTH:number, SEND
  4854. /LARGER:number.
  4855. * SCREEN MOVE-TO row and column number.
  4856. * Various SET DIAL parameters (timeout, retry limit, etc).
  4857. * Various SET SEND or RECEIVE parameters (packet length, window size,
  4858. etc).
  4859. * Various other SET parameters.
  4860. and:
  4861. * S-Expressions (explained in [410]Section 9).
  4862. Macro names used in numeric contexts must not include mathematical
  4863. operators. Although it is legal to create a macro called "foo+bar", in
  4864. a numeric context this would be taken as the sum of the values of "foo"
  4865. and "bar". Any such conflict can be avoided, of course, by enclosing
  4866. the macro name in \m(...).
  4867. [ [411]Top ] [ [412]Contents ] [ [413]C-Kermit Home ] [ [414]Kermit
  4868. Home ]
  4869. 8.3. New IF Conditions
  4870. Several new IF conditions are available:
  4871. IF DECLARED arrayname
  4872. Explained in [415]Section 8.6.
  4873. IF KBHIT
  4874. Allows a script to test whether a key was pressed without
  4875. actually trying to read it.
  4876. IF KERBANG (Unix only)
  4877. True if Kermit was started from a Kerbang script. This is useful
  4878. for knowing how to interpret the \&@[] and \&_[] argument vector
  4879. arrays, and under what conditions to exit.
  4880. IF INTEGER n
  4881. This is just a synonym for IF NUMERIC, which is true if n
  4882. contains only digits (or, if n is a variable, its value contains
  4883. only digits).
  4884. By contrast, IF FLOAT n succeeds if n is a floating-point number OR an
  4885. integer (or a variable with floating-point or integer value).
  4886. Therefore, IF FLOAT should be used whenever any kind of number is
  4887. acceptable, whereas IF INTEGER (or IF NUMERIC) when only an integer can
  4888. be used.
  4889. [ [416]Top ] [ [417]Contents ] [ [418]C-Kermit Home ] [ [419]Kermit
  4890. Home ]
  4891. 8.4. The ON_UNKNOWN_COMMAND Macro
  4892. The new ON_UNKNOWN_COMMAND macro, if defined, is executed whenever you
  4893. give a command that is not known to C-Kermit; any operands are passed
  4894. as arguments. Here are some sample definitions:
  4895. DEF ON_UNKNOWN_COMMAND telnet \%1 ; Treat unknown commands as hostnames
  4896. DEF ON_UNKNOWN_COMMAND dial \%1 ; Treat unknown commands phone numbers
  4897. DEF ON_UNKNOWN_COMMAND take \%1 ; Treat unknown commands as filenames
  4898. DEF ON_UNKNOWN_COMMAND !\%* ; Treat unknown commands as shell commands
  4899. The ON_CD macro, if defined, is executed whenever Kermit is given a CD
  4900. (change directory) command (8.0.211). Upon entry to this macro, the
  4901. directory has already changed and the new directory string is available
  4902. in the \v(directory) variable, and also as the first argument (\%1).
  4903. [ [420]Top ] [ [421]Contents ] [ [422]C-Kermit Home ] [ [423]Kermit
  4904. Home ]
  4905. 8.5. The SHOW MACRO Command
  4906. The SHOW MACRO command has been changed to accept more than one macro
  4907. name:
  4908. (setq a 1 b 2 c 3)
  4909. show mac a b c
  4910. a = 1
  4911. b = 2
  4912. c = 3
  4913. An exact match is required for each name (except that case doesn't
  4914. matter). If you include wildcard characters, however, a pattern match
  4915. is performed:
  4916. show mac [a-c]*x
  4917. shows all macros whose names start with a, b, or c, and end with x.
  4918. [ [424]Top ] [ [425]Contents ] [ [426]C-Kermit Home ] [ [427]Kermit
  4919. Home ]
  4920. 8.6. Arrays
  4921. A clarification regarding references to array names (as opposed to
  4922. array elements): You can use array-name "abbreviations" like &a only in
  4923. contexts that expect array names, like ARRAY commands or array-name
  4924. function arguments such as the second argument of \fsplit(). In a LOCAL
  4925. statement, however, you have to write \&a[], since "local &a" might
  4926. refer to a macro named "&a".
  4927. In function arguments, however, you MUST use the abbreviated form:
  4928. \fsplit(\%a,&a) or \fsplit(\%a,&a[]). If you include the backslash (as
  4929. in "\fsplit(\%a,\&a[])") a parse error occurs.
  4930. Here are the new array-related commands:
  4931. IF DECLARED arrayname
  4932. Allows a script to test whether an array has been declared. The
  4933. arrayname can be a non-array backslash variable such as \%1 or
  4934. \m(name), in which case it is evaluated first, and the result is
  4935. treated as the array name. Otherwise, arrayname is treated as in
  4936. the ARRAY commands: it can be a, &a, &a[], \&a, \&a[], \&a[3],
  4937. \&a[3:9], etc, with the appropriate results in each case.
  4938. Synonym: IF DCL.
  4939. UNDECLARE arrayname
  4940. UNDECLARE is a new top-level command to undeclare an array.
  4941. Previously this could only be done with "declare \&a[0]" (i.e.
  4942. re-declare the array with a dimension of 0).
  4943. ARRAY LINK linkname arrayname
  4944. Creates a symbolic link from the array named by linkname (which
  4945. must be the name of an array that is not yet declared in the
  4946. current context) to the array named by arrayname (which must the
  4947. name of a currently declared array that is not itself a link, or
  4948. a variable containing the name of such an array). The two names
  4949. indicate the same array: if you change an array element, the
  4950. change is reflected in the link too, and vice versa. If you
  4951. undeclare the link, the real array is unaffected. If you
  4952. undeclare the real array, all links to it disappear. If you
  4953. resize an array (directly or through a link), all links to it
  4954. are updated automatically.
  4955. Array links let you pass array names as arguments to macros. For
  4956. example, suppose you had a program that needed to uppercase all the
  4957. elements of different arrays at different times. You could write a
  4958. macro to do this, with the array name as an argument. But without array
  4959. links, there would be no way to refer to the argument array within the
  4960. macro. Array links make it easy:
  4961. define arrayupper {
  4962. local \&e[] \%i
  4963. array link \&e[] \%1
  4964. for i 1 \fdim(&e) 1 { .\&e[i] := \fupper(\&e[i]) }
  4965. }
  4966. declare \&a[] = these are some words
  4967. arrayupper &a
  4968. show array &a
  4969. The macro declares the array link LOCAL, which means it doesn't
  4970. conflict with any array of the same name that might exist outside the
  4971. macro, and that the link is destroyed automatically when the macro
  4972. exits. This works, by the way, even if the link name and the macro
  4973. argument name are the same, as long as the link is declared LOCAL.
  4974. As noted, you can't make a link to a nonexistent array. So when writing
  4975. a macro whose job is to create an array whose name is passed as an
  4976. argument, you must declare the array first (the size doesn't matter as
  4977. long as it's greater than 0). Example:
  4978. define tryme { ; Demonstration macro
  4979. local \&e[] ; We only need this inside the macro
  4980. array link \&e[] \%1 ; Make local link
  4981. shift ; Shift argument list
  4982. void \fsplit(\%*,&e) ; Split remainder of arg list into array
  4983. }
  4984. declare \&a[1] ; Declare target array in advance
  4985. tryme &a here are some words ; Invoke the macro with array name and words
  4986. show array a ; See the results
  4987. One final improvement allows the macro itself to declare the array
  4988. (this was not possible in earlier Kermit releases): if the array name
  4989. in the DECLARE command is a variable (and not an array name), or
  4990. includes variables, the resulting value is used as the array name. So:
  4991. define tryme { ; Demonstration macro
  4992. declare \%1[1] ; Preliminary declaration for target array
  4993. local \&e[] ; We only need this inside the macro
  4994. array link \&e[] \%1 ; Make local link
  4995. shift ; Shift argument list
  4996. void \fsplit(\%*,&e) ; Split remainder of arg list into array
  4997. }
  4998. tryme &a here are some words ; Invoke the macro with array name and words
  4999. show array a ; See the results
  5000. The SHOW ARRAY command now indicates whether an array name is a link.
  5001. Also see the descriptions of [428]\fjoin() and [429]\fsplit(), plus
  5002. [430]Section 8.10 on the MINPUT command, which shows how an entire
  5003. array (or segment of it) can be used as the MINPUT target list.
  5004. [ [431]Top ] [ [432]Contents ] [ [433]C-Kermit Home ] [ [434]Kermit
  5005. Home ]
  5006. 8.7. New or Improved Built-in Variables and Functions
  5007. The following new built-in variables are available:
  5008. \v(buildid) A date string like "20000808" indicating when C-Kermit was b
  5009. uilt.
  5010. \v(ftime) Current time, secs since midnight, including fraction of sec
  5011. ond.
  5012. \v(iprompt) The current SET PROMPT value
  5013. \v(sexp) The most recent S-Expression (see [435]Section 9)
  5014. \v(sdepth) The current S-Expression invocation depth ([436]Section 9)
  5015. \v(svalue) The value of the most recent S-Expression ([437]Section 9)
  5016. \v(ftp_code) Most recent FTP response code ([438]Section 3)
  5017. \v(ftp_connected) FTP connection status ([439]Section 3)
  5018. \v(ftp_cpl) FTP Command Protection Level ([440]Section 3.2)
  5019. \v(ftp_dpl) FTP Data Protection Level ([441]Section 3.2)
  5020. \v(ftp_getputremote) The current SET GET-PUT-REMOTE setting ([442]Section 3.8)
  5021. \v(ftp_host) Name or IP address of FTP server ([443]Section 3)
  5022. \v(ftp_loggedin) FTP login status ([444]Section 3)
  5023. \v(ftp_message) Most recent FTP response message ([445]Section 3)
  5024. \v(ftp_security) FTP Security method ([446]Section 3.2)
  5025. \v(ftp_server) OS type of FTP server ([447]Section 3)
  5026. \v(http_code) Most recent HTTP response code
  5027. \v(http_connected) HTTP connection status
  5028. \v(http_host) Name or IP address of HTTP server
  5029. \v(http_message) Most recent HTTP response message
  5030. \v(http_security) TLS cipher used to secure the HTTP session
  5031. \v(hour) Hour of the day, 0 to 23.
  5032. \v(timestamp) Equivalent to "\v(ndate) \v(time)".
  5033. \v(log_debug) Current debug log file, if any.
  5034. \v(log_packet) Current packet log file, if any.
  5035. \v(log_session) Current session log file, if any.
  5036. \v(log_transaction) Current transaction log file, if any.
  5037. \v(log_connection) Current connection log file, if any.
  5038. The following new or improved built-in functions are available:
  5039. \fcmdstack() Allows programmatic access to the command stack.
  5040. \fcvtdate() [448]Section 8.13, format options added
  5041. \fdelta2secs() [449]Section 8.13
  5042. \fdostounixpath(s1) Converts a DOS filename to Unix format.
  5043. \fsplit() Now allows grouping/nesting in source string.
  5044. \fword() Allows the same grouping and nesting.
  5045. \fjoin(&a,s1,n1,n2) Copies an array into a single string.
  5046. \fsubstitute(s1,s2,s3) Substitutes characters within a string.
  5047. \freplace() Has new 4th "occurrence" argument.
  5048. \fsexpression() Evaluates an S-Expression (explained in [450]Section 9
  5049. ).
  5050. \ftrim(), \fltrim() Now trim CR and LF by default, as well as SP and Tab.
  5051. \funixtodospath(s1) Converts a Unix filename to DOS format.
  5052. \fkeywordval(s1,c1) Assigns values to keywords (macros) (explained below).
  5053. Most functions that have "2" in their names to stand for the word "to"
  5054. can now also be written with "to", e.g. "\fdelta2secs(),"
  5055. \fdeltatosecs()."
  5056. \funtabify(string)
  5057. (New to 8.0.211) Replaces Horizontal Tab characters in the given
  5058. string with spaces based on VT100-like tab stops.
  5059. \fverify(s1,s2,n)
  5060. As of version 8.0.211, returns -1 if s2 is an empty string.
  5061. Previously it returned 0, making \fverify(abc,\%a) look as if
  5062. \%a was a string composed of a's, b's, and/or c's when in fact
  5063. it contained nothing.
  5064. \fcode(string)
  5065. As of version 8.0.211, returns 0 if string is empty or missing.
  5066. Previously it returned the empty string, which made it unsafe to
  5067. use in arithmetic or boolean expressions.
  5068. \v(inscale)
  5069. New to version 8.0.211, its value is the INPUT SCALE-FACTOR
  5070. ([451]Section 8.10), default 1.0.
  5071. 8.7.1. The \fkeywordval() Function
  5072. \fkeywordval(s1,c1) is new to C-Kermit 8.0. Given a string s1 of the
  5073. form "name=value", it creates a macro with the given name and assigns
  5074. it the given value. If no value appears after the equal sign, any
  5075. existing macro of the given name is undefined. Blanks are automatically
  5076. trimmed from around the name and value. The optional c1 parameter is
  5077. the assignment operator character, equal sign (=) by default. This
  5078. function is handy for processing keyword parameters or any other form
  5079. of parameter-value pair. Suppose, for example, you want to write a
  5080. macro that accepts keyword parameters rather than positional ones:
  5081. define MYDIAL {
  5082. local \%i modem hangup method device speed number
  5083. def number 5551234 ; Assign default parameter values
  5084. def speed 57600
  5085. def modem usrobotics
  5086. def hangup rs232
  5087. def method tone
  5088. def country 1
  5089. for \%i 1 \v(argc)-1 1 { ; Parse any keyword parameters...
  5090. if not \fkeywordval(\&_[\%i]) end 1 Bad parameter: "\&_[\%i]"
  5091. }
  5092. set dial country \m(country)
  5093. set modem type \m(modem)
  5094. set modem hang \m(hangup)
  5095. set dial method \m(tone)
  5096. set line \m(device)
  5097. if fail stop 1
  5098. set speed \m(speed)
  5099. if fail stop 1
  5100. show comm
  5101. set dial display on
  5102. dial \m(number)
  5103. if success connect
  5104. }
  5105. In this example, all the defaults are set up inside the macro, and
  5106. therefore it can be invoked with no parameters at all. But if you want
  5107. to have the macro dial a different number, you can supply it as
  5108. follows:
  5109. mydial number=7654321
  5110. You can supply any number of keyword parameters, and you can give them
  5111. in any order:
  5112. mydial number=7654321 hangup=modem speed=115200
  5113. 8.7.2. The \fsplit(), \fjoin(), and \fword() Functions
  5114. \fjoin(&a,s1,n1,n2) is also new; it creates a string from an array (or
  5115. a piece of one). &a is the name of the array (a range specifier can be
  5116. included); s1 is a character or string to separate each element in the
  5117. result string (can be omitted, in which case the elements are not
  5118. separated at all), and n1 is a grouping mask, explained below. If s1 is
  5119. empty or not specified, the array elements are separated with spaces.
  5120. If you want the elements concatenated with no separator, include a
  5121. nonzero n2 argument. Given the array:
  5122. declare \&a[] = 0 1 2 3 4 5 6 7 8 9
  5123. you can get effects like this:
  5124. \fjoin(&a) 0 1 2 3 4 5 6 7 8 9
  5125. \fjoin(&a,:) 0:1:2:3:4:5:6:7:8:9
  5126. \fjoin(&a,{,}) 0,1,2,3,4,5,6,7,8,9
  5127. \fjoin(&a,...) 0...1...2...3...4...5...6...7...8...9
  5128. \fjoin(&a,,,1) 0123456789
  5129. \fsplit(), \fword(), \fstripb(), and \fjoin() accept a "grouping mask"
  5130. argument, n1, which is a number from 0 to 63, in which:
  5131. 1 = "" doublequotes
  5132. 2 = {} braces
  5133. 4 = '' singlequotes
  5134. 8 = () parentheses
  5135. 16 = [] square brackets
  5136. 32 = <> angle brackets
  5137. These can be OR'd (added) together to make any number 0-63 (-1 is
  5138. treated the same as 63, 0 means no grouping). If a bit is on, the
  5139. corresponding kind of grouping is selected. (If more than 1 bit is set
  5140. for \fjoin(), only the lowest-order one is used.)
  5141. If you include the same character in the grouping mask and the include
  5142. list, the grouping mask takes precedence. Example:
  5143. def \%a a "b c d" e
  5144. \fsplit(\%a,&a[],,,-1) = 3 <-- doublequote used for grouping
  5145. \fsplit(\%a,&a[],,",-1) = 3 <-- doublequote still used for grouping
  5146. Nesting of matched left and right grouping characters (parentheses,
  5147. braces, and brackets, but not quotes) is recognized. Example:
  5148. def \%a a (b c <d e [f g {h i} j k] l m> n o) p
  5149. \fsplit(\%a,&a,,,0) = 16 (no grouping)
  5150. \fsplit(\%a,&a,,,2) = 15 (braces only)
  5151. \fsplit(\%a,&a,,,16) = 11 (square brackets only)
  5152. \fsplit(\%a,&a,,,32) = 7 (angle brackets only)
  5153. \fsplit(\%a,&a,,,63) = 3 (all)
  5154. \fsplit(\%a,&a,,,-1) = 3 (all)
  5155. \fsplit() and \fjoin() are "reciprocal" functions. You can split a
  5156. string up into an array and join it back into a new string that is
  5157. equivalent, as long as \fsplit() and \fjoin() are given equivalent
  5158. grouping masks, except that the type of braces might change. Example:
  5159. def \%a a {b c [d e] f g} "h i" j <k l> m
  5160. echo STRING=[\%a]
  5161. echo WORDS=\fsplit(\%a,&a,,,-1)
  5162. show array a
  5163. asg \%b \fjoin(&a,{ },2)
  5164. echo JOIN =[\%b]
  5165. echo WORDS=\fsplit(\%b,&b,,,-1)
  5166. show array b
  5167. The arrays a and b are identical. The strings a and b are as follows:
  5168. \%a: a {b c [d e] f g} "h i" j <k l> m
  5169. \%b: a {b c [d e] f g} {h i} j {k l} m
  5170. It is possible to quote separator grouping characters with backslash to
  5171. override their grouping function. And of course to include backslash
  5172. itself in the string, it must be quoted too. Furthermore, each
  5173. backslash must be doubled, so the command parser will still pass one
  5174. backslash to \fsplit() for each two that it sees. Here are some
  5175. examples using \fsplit() with a grouping mask of 8 (treat parentheses
  5176. as grouping characters).
  5177. String Result
  5178. a b c d e f 6
  5179. a b\\ c d e f 5
  5180. a b (c d e) f 4
  5181. a b \\(c d e\\) f 6
  5182. a b \\\\(c d e\\\\) f 7
  5183. \fsplit() has also been changed to create its array (if one is given)
  5184. each time it is called, so now it can be conveniently called in a loop
  5185. without having to redeclare the array each time.
  5186. Incidentally... Sometimes you might want to invoke \fsplit() in a
  5187. situation where you don't care about its return value, e.g. when you
  5188. just want to fill the array. Now you can "call" \fsplit() or any other
  5189. function with the new [452]VOID command:
  5190. void \fsplit(\%a,&a)
  5191. \fsplit() and \fjoin() also accept a new, optional 6th argument, an
  5192. options flag, a number that can specify a number of options. So far
  5193. there is just one option, whose value is 1:
  5194. separator-flag
  5195. Normally separators are collapsed. So, for example,
  5196. \fword(Three little words,2)
  5197. returns "little" (the second word). Space is a separator, but
  5198. there are multiple spaces between each word. If the value 1 is
  5199. included in the option flag, however, each separator counts. If
  5200. two separators are adjacent, an empty word is produced between
  5201. them. This is useful for parsing (e.g.) comma-separated lists
  5202. exported from databases or spreadsheets.
  5203. 8.7.3. The \fcmdstack() Function
  5204. The new \fcmdstack() function gives access to the command stack:
  5205. \fcmdstack(n1,n2)
  5206. Arguments: n1 is the command stack level. If omitted, the
  5207. current level, \v(cmdlevel), is used. n2 is a function code
  5208. specifying the desired type of information:
  5209. 0 (default) = name of object at level n1.
  5210. 1 (nonzero) = object type (0 = prompt; 1 = command file; 2 = macro).
  5211. The default for n2 is 0.
  5212. The name associated with prompt is "(prompt)". Here's a loop that can
  5213. be included in a macro or command file to show the stack (similar to
  5214. what the SHOW STACK command does):
  5215. for \%i \v(cmdlevel) 0 -1 {
  5216. echo \%i. [\fcmdstack(\%i,1)] \fcmdstack(\%i,0)
  5217. }
  5218. In this connection, note that \v(cmdfile) always indicates the most
  5219. recently invoked active command file (if any), even if that file is
  5220. executing a macro. Similarly, \v(macro) indicates the most recently
  5221. invoked macro (if any), even if the current command source is not a
  5222. macro. The name of the "caller" of the currently executing object
  5223. (command file or macro) is:
  5224. \fcmdstack(\v(cmdlevel)-1)
  5225. and its type is:
  5226. \fcmdstack(\v(cmdlevel)-1,1)
  5227. To find the name of the macro that invoked the currently executing
  5228. object, even if one or more intermediate command files (or prompting
  5229. levels) are involved, use a loop like this:
  5230. for \%i \v(cmdlevel)-1 0 -1 {
  5231. if = \fcmdstack(\%i,1) 2 echo CALLER = \fcmdstack(\%i,0)
  5232. }
  5233. Of course if you make a macro to do this, the macro must account for
  5234. its own additional level:
  5235. define CALLER {
  5236. for \%i \v(cmdlevel)-2 0 -1 {
  5237. if = \fcmdstack(\%i,1) 2 return \fcmdstack(\%i,0)
  5238. }
  5239. return "(none)"
  5240. }
  5241. The built-in variable \v(cmdsource) gives the current command source as
  5242. a word ("prompt", "file", or "macro").
  5243. 8.7.4. The VOID Command
  5244. VOID is like ECHO in that all functions and variables in its argument
  5245. text are evaluated. but it doesn't print anything (except possibly an
  5246. error message if a function was invocation contained or resulted in any
  5247. errors). VOID sets FAILURE if it encounters any errors, SUCCESS
  5248. otherwise.
  5249. [ [453]Top ] [ [454]Contents ] [ [455]C-Kermit Home ] [ [456]Kermit
  5250. Home ]
  5251. 8.8. The RETURN and END Commands
  5252. The execution of a macro is terminated in any of the following ways:
  5253. * With an END [ number [ message ] ] command. If a number is given,
  5254. the macro succeeds if the number is 0, and fails if it is not zero;
  5255. if a number is not given, the macro succeeds.
  5256. * With a STOP command, which works just like END except it peels back
  5257. the command stack all the way to top level.
  5258. * With a RETURN [ text ] command, in which case the macro always
  5259. succeeds.
  5260. * By running out of commands to execute, in which case the macro
  5261. succeeds or fails according the most recently executed command that
  5262. sets success or failure.
  5263. The same considerations apply to command files invoked by the TAKE
  5264. command.
  5265. If a macro does not execute any commands that set success or failure,
  5266. then invoking the macro does not change the current SUCCESS/FAILURE
  5267. status. It follows, then, that the mere invocation of a macro does not
  5268. change the SUCCESS/FAILURE status either. This makes it possible to
  5269. write macros to react to the status of other commands (or macros), for
  5270. example:
  5271. define CHKLINE {
  5272. if success end 0
  5273. stop 1 SET LINE failed - please try another device.
  5274. }
  5275. set modem type usrobotics
  5276. set line /dev/cua0
  5277. chkline
  5278. set speed 57600
  5279. dial 7654321
  5280. By the way, none of this is news. But it was not explicitly documented
  5281. before, and C-Kermit 7.0 and earlier did not always handle the RETURN
  5282. statement as it should have.
  5283. [ [457]Top ] [ [458]Contents ] [ [459]C-Kermit Home ] [ [460]Kermit
  5284. Home ]
  5285. 8.9. UNDEFINing Groups of Variables
  5286. The UNDEFINE command, which previously accepted one variable name, now
  5287. accepts a list of them, and also accepts wildcard notation to allow
  5288. deletion of variables that match a given pattern.
  5289. UNDEFINE [ switches ] name [ name [ name [ ... ] ] ]
  5290. Undefines the variables whose names are given. Up to 64 names
  5291. may be given in one UNDEFINE command.
  5292. If you omit the switches and include only one name, the UNDEFINE
  5293. command works as before.
  5294. Switches include:
  5295. /MATCHING
  5296. Specifies that the names given are to treated as patterns rather
  5297. than literal variable names. Note: pattern matching can't be
  5298. used with array references; use the ARRAY command to manipulate
  5299. arrays and subarrays.
  5300. /LIST
  5301. List the name of each variable to be undefined, and whether it
  5302. was undefined successfully ("ok" or "error"), plus a summary
  5303. count at the end.
  5304. /SIMULATE
  5305. List the names of the variables that would be deleted without
  5306. actually deleting them. Implies /LIST.
  5307. The UNDEFINE command fails if there were any errors and succeeds
  5308. otherwise.
  5309. The new _UNDEFINE command is like UNDEFINE, except the names are
  5310. assumed to be variable names themselves, which contain the names (or
  5311. parts of them) of the variables to be undefined. For example, if you
  5312. have the following definitions:
  5313. define \%a foo
  5314. define foo This is some text
  5315. then:
  5316. undef \%a
  5317. undefines the variable \%a, but:
  5318. _undef \%a
  5319. undefines the macro foo.
  5320. Normal Kermit patterns are used for matching; metacharacters include
  5321. asterisk, question mark, braces, and square brackets. Thus, when using
  5322. the /MATCHING switch, if the names of the macros you want to undefine
  5323. contain any of these characters, you must quote them with backslash to
  5324. force them to be taken literally. Also note that \%* is not the name of
  5325. a variable; it is a special notation used within a macro for "all my
  5326. arguments". The command "undef /match \%*" deletes all \%x variables,
  5327. where x is 0..9 and a..z. Use "undef /match \%[0-9]" to delete macro
  5328. argument variables or "undef /match \%[i-n]" to delete a range of \%x
  5329. variables.
  5330. [ [461]Top ] [ [462]Contents ] [ [463]C-Kermit Home ] [ [464]Kermit
  5331. Home ]
  5332. 8.10. The INPUT and MINPUT Commands
  5333. As of C-Kermit 8.0.211, the INPUT and MINPUT commands accept a switch:
  5334. [M]INPUT /NOMATCH timeout
  5335. The /NOMATCH switch allows INPUT or MINPUT to read incoming
  5336. material for the specified amount of time, without attempting to
  5337. match it with any text or patterns. When this switch is
  5338. included, the [M]INPUT command succeeds when the timeout
  5339. interval expires, with \v(instatus) set to 1, meaning "timed
  5340. out", or fails upon interruption or i/o error.
  5341. Also in version 8.0.211, there is a new way to apply a scale factor to
  5342. [M]INPUT timeouts:
  5343. SET INPUT SCALE-FACTOR floating-point-number
  5344. This scales all [M]INPUT timeouts by the given factor, allowing
  5345. time-sensitive scripts to be adjusted to changing conditions
  5346. such as congested networks or different-speed modems without
  5347. having to change each INPUT-class command. This affects only
  5348. those timeouts that are given in seconds, not as wall-clock
  5349. times. Although the scale factor can have a fractional part, the
  5350. INPUT timeout is still an integer. The new built-in variable
  5351. \v(inscale) tells the current INPUT SCALE-FACTOR.
  5352. The MINPUT command can be used to search the incoming data stream for
  5353. several targets simultaneously. For example:
  5354. MINPUT 8 one two three
  5355. waits up to 8 seconds for one of the words "one", "two", or "three" to
  5356. arrive. Words can be grouped to indicate targets that contain spaces:
  5357. MINPUT 8 nineteen twenty "twenty one"
  5358. And of course you can also use variables in place of (or as part of)
  5359. the target names:
  5360. MINPUT 8 \%a \&x[3] \m(foo)
  5361. Until now you had to know the number of targets in advance when writing
  5362. the MINPUT statement. Each of the examples above has exactly three
  5363. targets.
  5364. But suppose your script needs to look for a variable number of targets.
  5365. For this you can use arrays and \fjoin(), described in [465]Section
  5366. 8.7. Any number of \fjoin() invocations can be included in the MINPUT
  5367. target list, and each one is expanded into the appropriate number of
  5368. separate targets each time the MINPUT command is executed. Example:
  5369. declare \&a[10] = one two three
  5370. minput 10 foo \fjoin(&a) bar
  5371. This declares an array of ten elements, and assigns values to the first
  5372. three of them. The MINPUT command looks for these three (as well as the
  5373. words "foo" and "bar"). Later, if you assign additional elements to the
  5374. array, the same MINPUT command also looks for the new elements.
  5375. If an array element contains spaces, each word becomes a separate
  5376. target. To create one target per array element, use \fjoin()'s grouping
  5377. feature:
  5378. dcl \&a[] = {aaa bbb} {ccc ddd} {xxx yyy zzz}
  5379. minput 10 \fjoin(&a) <-- 7 targets
  5380. minput 10 \fjoin(&a,,2) <-- 3 targets
  5381. [ [466]Top ] [ [467]Contents ] [ [468]C-Kermit Home ] [ [469]Kermit
  5382. Home ]
  5383. 8.11. Learned Scripts
  5384. C-Kermit now includes a simple script recorder that monitors your
  5385. commands, plus your actions during CONNECT mode, and automatically
  5386. generates a script program that mimics what it observed. You should
  5387. think of this feature as a script-writing ASSISTANT since, as you will
  5388. see [470]later in this section, the result generally needs some editing
  5389. to make it both secure and flexible. The script recorder is controlled
  5390. by the new LEARN command:
  5391. LEARN [ /ON /OFF /CLOSE ] [ filename ]
  5392. If you give a filename, the file is opened for subsequent
  5393. recording. The /ON switch enables recording to the current file
  5394. (if any); /OFF disables recording. /CLOSE closes the current
  5395. script recording file (if any). If you give a filename without
  5396. any switches, /ON is assumed.
  5397. The /OFF and /ON switches let you turn recording off and on during a
  5398. session without closing the file.
  5399. When recording:
  5400. * All commands that you type (or recall) at the prompt are recorded
  5401. in the file except:
  5402. + LEARN commands are not recorded.
  5403. + The CONNECT command is not recorded.
  5404. + The TELNET command is converted to SET HOST /NETWORK:TCP.
  5405. * Commands obtained from macros or command files are not recorded.
  5406. * During CONNECT:
  5407. + Every line you type is converted to an OUTPUT command.
  5408. + The last prompt before any line you type becomes an INPUT
  5409. command.
  5410. + Timeouts are calculated automatically for each INPUT command.
  5411. + A PAUSE command is inserted before each OUTPUT command just to
  5412. be safe.
  5413. Thus the script recorder is inherently line-oriented. It can't be used
  5414. to script character-oriented interactions like typing Space to a
  5415. "More?" prompt or editing a text file with VI or EMACS.
  5416. But it has advantages too; for example it takes control characters into
  5417. account that might not be visible to you otherwise, and it
  5418. automatically converts control characters in both the input and output
  5419. streams to the appropriate notation. It can tell, for example that the
  5420. "$ " prompt on the left margin in UNIX is really {\{13}\{10}$ },
  5421. whereas in VMS it might be {\{13}\{10}\{13}$ }. These sequences are
  5422. detected and recorded automatically.
  5423. A learned script should execute correctly when you give a TAKE command
  5424. for it. However, it is usually appropriate to edit the script a bit.
  5425. The most important change would be to remove any passwords from it. For
  5426. example, if the script contains:
  5427. INPUT 9 {\{13}\{10}Password: }
  5428. IF FAIL STOP 1 INPUT timeout
  5429. PAUSE 1
  5430. OUTPUT bigsecret\{13}
  5431. you should replace this by something like:
  5432. INPUT 9 {\{13}\{10}Password: }
  5433. IF FAIL STOP 1 INPUT timeout
  5434. ASKQ pswd Please type your password:
  5435. PAUSE 1
  5436. OUTPUT \m(pswd)\{13}
  5437. The LEARN command can't do this for you since it knows nothing about
  5438. "content"; it only knows about lines and can't be expected to parse or
  5439. understand them -- after all, the Password prompt might be in some
  5440. other language. So remember: if you use the LEARN command to record a
  5441. login script, be sure edit the resulting file to remove any passwords.
  5442. Also be sure to delete any backup copies your editor or OS might have
  5443. made of the file.
  5444. Other manual adjustments might also be appropriate:
  5445. * If the target of an INPUT command can vary, you can replace the
  5446. INPUT command with MINPUT and the appropriate target list, and/or
  5447. the target with a \fpattern(). For example, suppose you are dialing
  5448. a number that can be answered by any one of 100 terminal servers,
  5449. whose prompts are ts-00>, ts-01>, ts-02>, ... ts-99>. The script
  5450. records a particular one of these, but you want it to work for all
  5451. of them, so change (e.g.):
  5452. INPUT 10 ts-23> ; or whatever
  5453. to:
  5454. INPUT 10 \fpattern(ts-[0-9][0-9]>)
  5455. * The INPUT timeout values are conservative, but they are based only
  5456. on a single observation; you might need to tune them.
  5457. * The PAUSE commands might not be necessary, or the PAUSE interval
  5458. might need adjustment.
  5459. * In case you made typographical errors during recording, they are
  5460. incorporated in your script; you can edit them out if you want to.
  5461. Here is a sample script generated by Kermit ("learn vms.ksc") in which
  5462. a Telnet connection is made to a VMS computer, the user logs in, starts
  5463. Kermit on VMS, sends it a file, and then logs out:
  5464. ; Scriptfile: vms.ksc
  5465. ; Directory: /usr/olga
  5466. ; Recorded: 20001124 15:21:23
  5467. SET HOST /NETWORK:TCP vms.xyzcorp.com
  5468. IF FAIL STOP 1 Connection failed
  5469. INPUT 7 {\{13}\{10}\{13}Username: }
  5470. IF FAIL STOP 1 INPUT timeout
  5471. PAUSE 1
  5472. OUTPUT olga\{13}
  5473. INPUT 3 {\{13}\{10}\{13}Password: }
  5474. IF FAIL STOP 1 INPUT timeout
  5475. PAUSE 1
  5476. OUTPUT secret\{13}
  5477. INPUT 18 {\{13}\{10}\{13}$ }
  5478. IF FAIL STOP 1 INPUT timeout
  5479. PAUSE 1
  5480. OUTPUT set default [.incoming]\{13}
  5481. INPUT 12 {\{13}\{10}\{13}$ }
  5482. IF FAIL STOP 1 INPUT timeout
  5483. PAUSE 1
  5484. OUTPUT kermit\{13}
  5485. INPUT 15 {\{13}\{10}\{13}ALTO:[OLGA.INCOMING] C-Kermit>}
  5486. IF FAIL STOP 1 INPUT timeout
  5487. PAUSE 1
  5488. OUTPUT receive\{13}
  5489. send myfile.txt
  5490. INPUT 18 {\{13}\{10}\{13}ALTO:[OLGA.INCOMING] C-Kermit>}
  5491. IF FAIL STOP 1 INPUT timeout
  5492. PAUSE 1
  5493. OUTPUT exit\{13}
  5494. INPUT 6 {\{13}\{10}\{13}$ }
  5495. IF FAIL STOP 1 INPUT timeout
  5496. PAUSE 1
  5497. OUTPUT logout\{13}
  5498. close
  5499. exit
  5500. The commands generated by Kermit during CONNECT (INPUT, IF FAIL, PAUSE,
  5501. and OUTPUT) have uppercase keywords; the commands typed by the user are
  5502. in whatever form the user typed them (in this case, lowercase).
  5503. [ [471]Top ] [ [472]Contents ] [ [473]C-Kermit Home ] [ [474]Kermit
  5504. Home ]
  5505. 8.12. Pattern Matching
  5506. A pattern is a character string that is used to match other strings.
  5507. Patterns can contain metacharacters that represent special actions like
  5508. "match any single character", "match zero or more characters", "match
  5509. any single character from a list", and so on. The best known
  5510. application of patterns is in file specifications that contain
  5511. wildcards, as in "send *.txt", meaning "send all files whose names end
  5512. with .txt".
  5513. Patterns are also used in increasingly many other ways, to the extent
  5514. it is useful to point out certain important distinctions in the ways in
  5515. which they are used:
  5516. Anchored Patterns
  5517. If an anchored pattern does not begin with "*", it must match
  5518. the beginning of the string, and if it does not end with "*", it
  5519. must match the end of the string. For example, the anchored
  5520. pattern "abc" matches only the string "abc", not "abcde" or
  5521. "xyzabc" or "abcabc". The anchored pattern "abc*" matches any
  5522. string that starts with "abc"; the anchored pattern "*abc"
  5523. matches any string that ends with "abc"; the anchored pattern
  5524. "*abc*" matches any string that contains "abc" (including any
  5525. that start and/or end with it).
  5526. Floating Patterns
  5527. A floating pattern matches any string that contains a substring
  5528. that matches the pattern. In other words, a floating pattern has
  5529. an implied "*" at the beginning and end. You can anchor a
  5530. floating pattern to the beginning by starting it with "^", and
  5531. you can anchor it to the end by ending it with "$" (see examples
  5532. below).
  5533. Wildcards
  5534. A wildcard is an anchored pattern that has the additional
  5535. property that "*" does not match directory separators.
  5536. This terminology lets us describe Kermit's commands with a bit more
  5537. precision. When a pattern is used for matching filenames, it is a
  5538. wildcard, except in the TEXT-PATTERNS and BINARY-PATTERNS lists and
  5539. /EXCEPT: clauses, in which case directory separators are not
  5540. significant (for example, a BINARY-PATTERN of "*.exe" matches any file
  5541. whose name ends in .exe, no matter how deeply it might be buried in
  5542. subdirectories). When Kermit parses a file specification directly,
  5543. however, it uses the strict wildcard definition. For example, "send
  5544. a*b" sends all files whose names start with "a" and end with "b" in the
  5545. current directory, and not any files whose names end with "b" that
  5546. happen to be in subdirectories whose names start with "a". And as
  5547. noted, wildcards are anchored, so "delete foo" deletes the file named
  5548. "foo", and not all files whose names happen to contain "foo".
  5549. Most other patterns are anchored. For example:
  5550. if match abc bc ...
  5551. does not succeed (and you would be surprised if it did!). In fact, the
  5552. only floating patterns are the ones used by commands or functions that
  5553. search for patterns in files, arrays, or strings. These include:
  5554. * The GREP and TYPE /MATCH commands.
  5555. * The \fsearch(), \frsearch(), and \farraylook() functions.
  5556. Thus these are the only contexts in which explicit anchors ("^" and
  5557. "$") may be used:
  5558. grep abc *.txt
  5559. Prints all lines containing "abc" in all files whose names end
  5560. with ".txt".
  5561. grep ^abc *.txt
  5562. Prints all lines that start with "abc" in all ".txt" files.
  5563. grep abc$ *.txt
  5564. Prints all lines that end with "abc" in all ".txt" files.
  5565. grep ^a*z$ *.txt
  5566. Prints all lines that start with "a" and end with "z" in all
  5567. ".txt" files.
  5568. Similarly for TYPE /PAGE, /fsearch(), /frsearch(), and \farraylook().
  5569. Here is a brief summary of anchored and floating pattern equivalences:
  5570. Anchored Floating
  5571. abc ^abc$
  5572. *abc abc$
  5573. abc* ^abc
  5574. *abc* abc
  5575. [ [475]Top ] [ [476]Contents ] [ [477]C-Kermit Home ] [ [478]Kermit
  5576. Home ]
  5577. 8.13. Dates and Times
  5578. C-Kermit's comprehension of date-time formats is considerably expanded
  5579. in version 8.0. Any command that reads dates, including the DATE
  5580. command itself, or any switch, such as the /BEFORE: and /AFTER:
  5581. switches, or any function such as \fcvtdate(), now can understand dates
  5582. and times expressed in any ISO 8601 format, in Unix "asctime" format,
  5583. in FTP MDTM format, and in practically any format used in RFC 822 or
  5584. RFC 2822 electronic mail, with or without timezones, and in a great
  5585. many other formats as well. HELP DATE briefly summarizes the acceptable
  5586. date-time formats.
  5587. Furthermore, C-Kermit 8.0 includes a new and easy-to-use form of
  5588. date-time arithmetic, in which any date or time can be combined with a
  5589. "delta time", to add or subtract the desired time interval (years,
  5590. months, weeks, days, hours, minutes, seconds) to/from the given date.
  5591. And new functions are available to compare dates and to compute their
  5592. differences.
  5593. As you can imagine, all this requires quite a bit of "syntax". The
  5594. basic format is:
  5595. [ date ] [ time ] [ delta ]
  5596. Each field is optional, but in most cases (depending on the context)
  5597. there must be at least one field. If a date is given, it must come
  5598. first. If no date is given, the current date is assumed. If no time is
  5599. given, an appropriate time is supplied depending on whether a date was
  5600. supplied. If no delta is given, no arithmetic is done. If a delta is
  5601. given without a date or time, the current date and time are used as the
  5602. base.
  5603. Date-time-delta fields are likely to contain spaces (although they need
  5604. not; space-free forms are always available). Therefore, in most
  5605. contexts -- and notably as switch arguments -- date-time information
  5606. must be enclosed in braces or doublequotes, for example:
  5607. send /after:"8-Aug-2001 12:00 UTC" *.txt
  5608. Kermit's standard internal format for dates and times is:
  5609. yyyymmdd hh:mm:ss
  5610. for example:
  5611. 20010208 10:28:01
  5612. Date-times can always be given in this format. yyyy is the 4-digit
  5613. year, mm is the two-digit month (1-12; supply leading zero for
  5614. Jan-Sep), dd is the 2-digit day (leading zero for 1-9), hh is the hour
  5615. (0-23), mm the minute (0-59), ss the second (0-59), each with leading
  5616. zero if less than the field width. The date and time can be separated
  5617. by a space, an underscore, a colon, or the letter T. The time is in
  5618. 24-hour format. Thus the various quantities are at the following fixed
  5619. positions:
  5620. Position Contents
  5621. 1-4 Year (4 digits, 0000-9999)
  5622. 5-6 Month (2 digits, 1-12)
  5623. 7-8 Day (2 digits, 1-31)
  5624. 9 Date-Time Separator (space, :, _, or the letter T)
  5625. 10-11 Hour (2 digits, 0-23)
  5626. 12 Hour-Minute Separator (colon)
  5627. 13-14 Minute (2 digits, 0-59)
  5628. 15 Minute-Second Separator (colon)
  5629. 16-17 Second (2 digits, 0-59)
  5630. Example:
  5631. 19800526 13:07:12 26 May 1980, 13:07:12 (1:07:12PM)
  5632. This is the format produced by the DATE command and by any function
  5633. that returns a date-time. It is suitable for lexical comparison and
  5634. sorting, and for use as a date-time in any Kermit command. When this
  5635. format is given as input to a command or function, various date-time
  5636. separators (as noted) are accepted:
  5637. 19800526 13:07:12 26 May 1980, 13:07:12 (1:07:12PM)
  5638. 20010208_10:28:35 2 February 2001, 10:28:35 AM
  5639. 18580101:12:00:00 1 January 1858, noon
  5640. 20110208T00:00:00 2 February 2011, midnight
  5641. Certain other special date-time formats that are encountered on
  5642. computer networks are recognized:
  5643. Asctime Format
  5644. This is a fixed format used by Unix, named after Unix's
  5645. asctime() ("ASCII time") function. It is always exactly 24
  5646. characters long. Example: Fri Aug 10 16:38:01 2001
  5647. Asctime with Timezone
  5648. This is like Asctime format, but includes a 3-character timezone
  5649. between the time and year. It is exactly 28 characters long.
  5650. Example: Fri Aug 10 16:38:01 GMT 2001
  5651. E-Mail Format
  5652. E-mail date-time formats are defined in [479]RFC 2822 with a
  5653. fair amount of flexibility and options. The following examples
  5654. are typical of e-mails and HTTP (web-page) headers:
  5655. Sat, 14 Jul 2001 11:49:29 (No timezone)
  5656. Fri, 24 Mar 2000 14:19:59 EST (Symbolic timezone)
  5657. Tue, 26 Jun 2001 10:19:45 -0400 (EDT) (GMT Offset + comment)
  5658. FTP MDTM Format
  5659. This is the date-time format supplied by FTP servers that
  5660. support the (not yet standard but widely used nevertheless) MDTM
  5661. command, by which the FTP client asks for a file's modification
  5662. time:
  5663. yyyymmddhhmmss[.ffff]
  5664. where yyyy is the 4-digit year, mm is the 2-digit month, and so
  5665. on, exactly 14 digits long. An optional fractional part
  5666. (fraction of second) may also be included, separated by a
  5667. decimal point (period). Kermit rounds to the nearest second.
  5668. Example:
  5669. 20020208102835.515 (8 February 2002 10:28:36 AM)
  5670. 8.13.1. The Date
  5671. The date, if given, must precede the time and/or delta, and can be in
  5672. many, many formats. For starters, you can use several symbolic date
  5673. names in place of actual dates:
  5674. NOW
  5675. This is replaced by the current date and time. The time can not
  5676. be overriden (if you want to supply a specific time, use TODAY
  5677. rather than NOW).
  5678. TODAY
  5679. This is replaced by the current date and a default time of
  5680. 00:00:00 is supplied, but can be overridden by a specific time;
  5681. for example, if today is 8 February 2002, then "TODAY" is
  5682. "20020802 00:00:00" but "TODAY 10:28" is "20020802 10:28:00".
  5683. TOMORROW
  5684. Like TODAY, but one day later (if today is 8 February 2002, then
  5685. "TOMORROW" is "20020803 00:00:00" but "TOMORROW 16:30" is
  5686. "20020803 16:30:00").
  5687. YESTERDAY
  5688. Like TODAY, but one day earlier.
  5689. MONDAY, TUESDAY, WEDNESDAY, ..., SUNDAY
  5690. The date on the given day of the week, today or later. A default
  5691. time of 00:00:00 is supplied but can be overridden. Example:
  5692. "SATURDAY 12:00" means next Saturday (or today, if today is
  5693. Saturday) at noon.
  5694. You can give an explicit date in almost any conceivable format, but
  5695. there are some rules:
  5696. * If a date is given, it must have three fields: day, month, and
  5697. year; the order can vary (except that the month can not be last).
  5698. * If names are used for days, months, etc, they must be English.
  5699. * The year must lie between 0000 and 9999, inclusive.
  5700. * All calendar calculations use Gregorian dating, so calculated dates
  5701. for years prior to 1582 (or later, depending on the country) will
  5702. not agree with historical dates. Other forms of dating (e.g.
  5703. Hebrew, Chinese) are not supported.
  5704. Various date-field separators are accepted: hyphen, slash, space,
  5705. underscore, period. The same field separator (if any) must be used in
  5706. both places; for example 18-Sep-2001 but not 18-Sep/2001. Months can be
  5707. numeric (1-12) or English names or abbreviations. Month name
  5708. abbreviations are normally three letters, e.g. Apr, May, Jun, Jul.
  5709. Capitalization doesn't matter.
  5710. Here are a few examples:
  5711. 18 Sep 2001 (English month, abbreviated)
  5712. 18 September 2001 (English month, spelled out)
  5713. 2001 Sept 18 (Year, month, day)
  5714. 18-Sep-2001 (With hyphens)
  5715. 18/09/2001 (All numeric with slashes)
  5716. 18.09.2001 (Ditto, with periods)
  5717. 18_09_2001 (Ditto, with underscores)
  5718. 09/18/2001 (See below)
  5719. 2001/09/18 (See below)
  5720. September 18, 2001 (Correspondence style)
  5721. Sep-18-2001 (Month-day-year)
  5722. 20010918 (Numeric, no separators)
  5723. You can also include the day of the week with a specific date, in which
  5724. case it is accepted (if it is a valid day name), but not verified to
  5725. agree with the given date:
  5726. Tue, 18 Sep 2001 (Abbreviated, with comma)
  5727. Tue,18 Sep 2001 (Comma but no space)
  5728. Tue 18 Sep 2001 (Abbreviated, no comma)
  5729. Tuesday 18 Sep 2001 (Spelled out)
  5730. Tuesday, 18 Sep 2001 (etc)
  5731. Friday, 18 Sep 2001 (Accepted even if not Friday)
  5732. In all-numeric dates with the year last, such as 18/09/2001, Kermit
  5733. identifies the year because it's 4 digits, then decides which of the
  5734. other two numbers is the month or day based on its value. If both are
  5735. 12 or less and are unequal, the date is ambiguous and is rejected. In
  5736. all-numeric dates with the year first, the second field is always the
  5737. month and the third is the day. The month never comes last. A date with
  5738. no separators is accepted only if it is all numeric and has exactly
  5739. eight digits, and is assumed to be in yyyymmdd format.
  5740. 20010918 (18-Sep-2001 00:00:00)
  5741. or 14 digits (as in FTP MDTM format):
  5742. 20010918123456 (18-Sep-2001 12:34:56)
  5743. You can always avoid ambiguity by putting the year first, or by using
  5744. an English, rather than numeric, month. A date such as 09/08/2001 would
  5745. be ambiguous but 2001/09/08 is not, nor is 09-Aug-2001.
  5746. Until the late 1990s, it was common to encounter 2-digit years, and
  5747. these are found to this day in old e-mails and other documents. Kermit
  5748. accepts these dates if they have English months, and interprets them
  5749. according to the windowing rules of [480]RFC 2822: "If a two digit year
  5750. is encountered whose value is between 00 and 49, the year is
  5751. interpreted by adding 2000, ending up with a value between 2000 and
  5752. 2049. If a two digit year is encountered with a value between 50 and
  5753. 99, or any three digit year is encountered, the year is interpreted by
  5754. adding 1900."
  5755. If you need to specify a year prior to 1000, use leading zeros to
  5756. ensure it is not misinterpreted as a "non-Y2K-compliant" modern year:
  5757. 7-Oct-77 (19771007 00:00:00)
  5758. 7-Oct-0077 (00771007 00:00:00)
  5759. 8.13.2. The Time
  5760. The basic time format is hh:mm:dd; that is hours, minutes, seconds,
  5761. separated by colons, perhaps with an optional fractional second
  5762. separated by a decimal point (period). The hours are in 24-hour format;
  5763. 12 is noon, 13 is 1pm, and so on. Fields omitted from the right default
  5764. to zero. Fields can be omitted from the left or middle by including the
  5765. field's terminating colon. Examples:
  5766. 11:59:59 (11:59:59 AM)
  5767. 11:59 (11:59:00 AM)
  5768. 11 (11:00:00 AM)
  5769. 11:59:59.33 (11:59:59 AM)
  5770. 11:59:59.66 (Noon)
  5771. 03:21:00 (3:21:00 AM)
  5772. 3:21:00 (3:21:00 AM)
  5773. 15:21:00 (3:21:00 PM)
  5774. :21:00 (00:21:00 AM)
  5775. ::01 (00:00:01 AM)
  5776. 11::59 (11:00:59 AM)
  5777. Leading zeros can be omitted, but it is customary and more readable to
  5778. keep them in the minute and second fields:
  5779. 03:02:01 (03:02:01 AM)
  5780. 3:02:01 (03:02:01 AM)
  5781. 3:2:1 (03:02:01 AM)
  5782. AM/PM notation is accepted if you wish to use it:
  5783. 11:59:59 (11:59:59 AM)
  5784. 11:59:59AM (11:59:59 AM)
  5785. 11:59:59A.M. (11:59:59 AM)
  5786. 11:59:59am (11:59:59 AM)
  5787. 11:59:59a.m. (11:59:59 AM)
  5788. 11:59:59PM (11:59:59 PM = 23:59:59)
  5789. 11:59:59P.M. (11:59:59 PM = 23:59:59)
  5790. 11:59:59pm (11:59:59 PM = 23:59:59)
  5791. 11:59:59p.m. (11:59:59 PM = 23:59:59)
  5792. You can omit the colons if you wish, in which case Kermit uses the
  5793. following rules to interpret the time:
  5794. 1. 6 digits is hh:mm:ss, e.g. 123456 is 12:34:56.
  5795. 2. 5 digits is h:mm:ss, e.g. 12345 is 1:23:45.
  5796. 3. 4 digits is hh:mm, e.g. 1234 is 12:34.
  5797. 4. 3 digits is h:mm, e.g. 123 is 1:23.
  5798. 5. 2 digits is hh, e.g. 12 is 12:00.
  5799. 6. 1 digit is h (the hour), e.g. 1 is 1:00.
  5800. Examples:
  5801. 1 (01:00:00 AM)
  5802. 10 (10:00:00 AM)
  5803. 230 (02:30:00 AM)
  5804. 230pm (02:30:00 PM = 14:30:00)
  5805. 1115 (11:15:00 AM)
  5806. 2315 (11:15:00 PM = 23:15:00 PM)
  5807. 23150 (02:31:50 AM)
  5808. 231500 (23:15:00 PM)
  5809. 8.13.3. Time Zones
  5810. If a time is given, it can (but need not) be followed by a time zone
  5811. designator. If no time zone is included, the time is treated as local
  5812. time and no timezone conversions are performed.
  5813. The preferred time zone designator is the UTC Offset, as specified in
  5814. [481]RFC 2822: a plus sign or minus sign immediately followed by
  5815. exactly four decimal digits, signifying the difference in hh (hours)
  5816. and mm (minutes) from Universal Coordinated Time (UTC, also known as
  5817. Greenwich Mean Time, or GMT), with negative numbers to the West and
  5818. positive numbers to the East. For example:
  5819. Fri, 13 Jul 2001 12:54:29 -0700
  5820. indicates a local time of 12:54:29 that is 07 hours and 00 minutes
  5821. behind (less than, East of) Universal Time. The space is optional, so
  5822. the example could also be written as:
  5823. Fri, 13 Jul 2001 12:54:29-0700
  5824. The following symbolic time zones are also accepted, as specified by
  5825. [482]RFC 2822 and/or in ISO 8601:
  5826. GMT = +0000 Greenwich Mean Time
  5827. Z = +0000 Zulu (Zero Meridian) Time
  5828. UTC = +0000 Universal Coordinated Time
  5829. UT = +0000 Universal Time
  5830. EDT = -0400 Eastern (USA) Daylight Time
  5831. EST = -0500 Eastern (USA) Standard Time
  5832. CDT = -0500 Central (USA) Daylight Time
  5833. CST = -0600 Central (USA) Standard Time
  5834. MDT = -0600 Mountain (USA) Daylight Time
  5835. MST = -0700 Mountain (USA) Standard Time
  5836. PDT = -0700 Pacific (USA) Daylight Time
  5837. PST = -0800 Pacific (USA) Standard Time
  5838. Note that GMT, Z, UTC, and UT all express the same concept: standard
  5839. (not daylight) time at the Zero Meridian. UTC, by the way, is an
  5840. international standard symbol and does not correspond to the order of
  5841. the English words, Universal Coordinated Time, but it happens to have
  5842. the same initial letters as these words. Of course hundreds of other
  5843. symbolic timezones and variations exist, but they are not standardized,
  5844. and are therefore not supported by Kermit.
  5845. When a time zone is included with a time, the time is converted to
  5846. local time. In case the conversion crosses a midnight boundary, the
  5847. date is adjusted accordingly. Examples converting to EST (Eastern USA
  5848. Standard Time = -0500):
  5849. 11:30:00 = 11:30:00
  5850. 11:30:00 EST = 11:30:00
  5851. 11:30:00 GMT = 06:30:00
  5852. 11:30:00 PST = 14:30:00
  5853. 11:30:00Z = 06:30:00
  5854. 11:30PM GMT = 18:30:00
  5855. 11:30 -0500 = 11:30:00
  5856. 11:30 -0800 = 08:30:00
  5857. 11:30 +0200 = 04:30:00
  5858. Unlike most of Kermit's other date-time conversions, timezone knowledge
  5859. (specifically, the offset of local time from UTC) is embodied in the
  5860. underlying operating system, not in Kermit itself, and any conversion
  5861. errors in this department are the fault of the OS. For example, most
  5862. UNIX platforms do not perform conversions for years prior to 1970.
  5863. 8.13.4. Delta Time
  5864. Date/time expressions can be composed of a date and/or time and a delta
  5865. time, or a delta time by itself. When a delta time is given by itself,
  5866. it is relative to the current local date and time. Delta times have the
  5867. following general format:
  5868. {+,-}[number units][hh[:mm[:ss]]]
  5869. In other words, a delta time always starts with a plus or minus sign,
  5870. which is followed by a "part1", a "part2", or both. The "part1", if
  5871. given, specifies a number of days, weeks, months, or years; "part2"
  5872. specifies a time in hh:mm:ss notation. In arithmetic terms, these
  5873. represents some number of days or other big time units, and then a
  5874. fraction of a day expressed as hours, minutes, and seconds; these are
  5875. to be added to or subtracted from the given (or implied) date and time.
  5876. The syntax is somewhat flexible, as shown by the following examples:
  5877. +1 day (Plus one day)
  5878. +1day (Ditto)
  5879. +1d (Ditto)
  5880. + 1 day (Ditto)
  5881. + 1 day 3:00 (Plus one day and 3 hours)
  5882. +1d3:00 (Ditto)
  5883. +1d3 (Ditto)
  5884. +3:00:00 (Plus 3 hours)
  5885. +3:00 (Ditto)
  5886. +3 (Ditto)
  5887. +2 days (Plus 2 days)
  5888. -12 days 7:14:22 (Minus 12 days, 7 hours, 14 minutes, and 22 seconds)
  5889. The words "week", "month", and "year" can be used like "day" in the
  5890. examples above. A week is exactly equivalent to 7 days. When months are
  5891. specified, the numeric month number of the date is incremented or
  5892. decremented by the given number, and the year and day adjusted
  5893. accordingly if necessary (for example, 31-Jan-2001 +1month =
  5894. 03-Mar-2001 because February does not have 31 days). When years are
  5895. specified, they are added or subtracted to the base year. Examples
  5896. (assuming the current date is 10-Aug-2001 and the current time is
  5897. 19:21:11):
  5898. 18-Sep-2001 +1day (20010918 00:00:00)
  5899. today +1day (20010811 00:00:00)
  5900. now+1d (20010811 19:21:11)
  5901. + 1 day (20010811 19:21:11)
  5902. + 1 day 3:14:42 (20010811 22:35:54)
  5903. + 7 weeks (20010928 19:21:11)
  5904. +1d3:14:42 (20010811 22:35:54)
  5905. +1w3:14:42 (20010817 22:35:54)
  5906. +1m3:14:42 (20010910 22:35:54)
  5907. +1y3:14:42 (20020810 22:35:54)
  5908. 2 feb 2001 + 10 years (20110208 00:00:00)
  5909. 2001-02-08 +10y12 (20110208 12:00:00)
  5910. 31-dec-1999 23:59:59+00:00:01 (20000101 00:00:00)
  5911. 28-feb-1996 +1day (19960229 00:00:00) (leap year)
  5912. 28-feb-1997 +1day (19970301 00:00:00) (nonleap year)
  5913. 28-feb-1997 +1month (19970328 00:00:00)
  5914. 28-feb-1997 +1month 11:59:59 (19970328 11:59:59)
  5915. 28-feb-1997 +20years (20170228 00:00:00)
  5916. 28-feb-1997 +8000years (99970228 00:00:00)
  5917. For compatibility with VMS, the following special delta-time format is
  5918. also accepted:
  5919. +number-hh:mm:ss
  5920. -number-hh:mm:ss
  5921. (no spaces). The hyphen after the number indicates days. It corresponds
  5922. exactly to the Kermit notation:
  5923. +numberdhh:mm:ss
  5924. -numberdhh:mm:ss
  5925. The following forms all indicate exactly the same date and time:
  5926. 18-Sep-2001 12:34:56 +1-3:23:01
  5927. 18-Sep-2001 12:34:56 +1d3:23:01
  5928. 18-Sep-2001 12:34:56 +1 day 3:23:01
  5929. and mean "add a day plus 3 hours, 23 minutes, and 1 second" to the
  5930. given date.
  5931. Note that delta times are not at all the same as UTC offsets; the
  5932. former specifies an adjustment to the given date/time and the latter
  5933. specifies that the local time is a particular distance from Universal
  5934. Time, for example:
  5935. 11-Aug-2001 12:34:56 -0800 (20010811 16:34:56 -- UTC Offset)
  5936. 11-Aug-2001 12:34:56 -08:00 (20010811 04:34:56 -- Delta time)
  5937. If you give a time followed by a modifier that starts with a + or -
  5938. sign, how does Kermit know whether it's a UTC offset or a delta time?
  5939. It is treated as a UTC offset if the sign is followed by exactly four
  5940. decimal digits; otherwise it is a delta time. Examples (for USA Eastern
  5941. Daylight Time):
  5942. 11-Aug-2001 12:34:56 -0800 (20010811 16:34:56 -- UTC Offset)
  5943. 11-Aug-2001 12:34:56 -08:00 (20010811 04:34:56 -- Delta time)
  5944. 11-Aug-2001 12:34:56 -800 (20010811 04:34:56 -- Delta time)
  5945. 11-Aug-2001 12:34:56 -8 (20010811 04:34:56 -- Delta time)
  5946. The first example says that at some unknown place which is 8 hours
  5947. ahead of Universal Time, the time is 12:34:56, and this corresponds to
  5948. 16:34:56 in Eastern Daylight time. The second example says to subtract
  5949. 8 hours from the local time. The third and fourth are delta times
  5950. because, even though a colon is not included, the time does not consist
  5951. of exactly 4 digits.
  5952. When a delta time is written after a timezone, however, there is no
  5953. ambiguity and no syntax distinction is required:
  5954. 11-Aug-2001 12:34:56 -0800 -0800 (20010811 08:34:56)
  5955. 11-Aug-2001 12:34:56 -0800 -08:00 (Ditto)
  5956. 11-Aug-2001 12:34:56 -08:00 -08:00 (Illegal)
  5957. 8.13.5. The DATE Command
  5958. Obviously a great many combinations of date, time, time zone, and delta
  5959. time are possible, as well as many formatting options. The purpose of
  5960. all this flexibility is to comply with as many standards as possible --
  5961. Internet RFCs, ISO standards, and proven corporate standards -- as well
  5962. as with notations commonly used by real people, in order that dates and
  5963. times from the widest variety of sources can be assigned to a variable
  5964. and used in any date-time field in any Kermit command.
  5965. You can test any date-and/or-time format with the DATE command, which
  5966. converts it to standard yyyymmdd hh:mm:ss format if it is understood,
  5967. or else gives an explicit error message (rather than just "BAD DATE" as
  5968. in previous C-Kermit releases) to indicate what is wrong with it.
  5969. Examples (on Tuesday, 31 July 2001 in New York City, Eastern Daylight
  5970. Time, UTC -0400):
  5971. DATE command argument Result
  5972. 12:30 20010731 12:30:00
  5973. 12:30:01 20010731 12:30:01
  5974. 12:30:01.5 20010731 12:30:02
  5975. 1230 20010731 12:30:00
  5976. 230 20010731 02:30:00
  5977. 230+1d 20010801 02:30:00
  5978. 230+1d3:00 20010801 05:30:00
  5979. 20010718 19:21:15 20010718 19:21:15
  5980. 20010718_192115 20010718 19:21:15
  5981. 20010718T192115 20010718 19:21:15
  5982. 18 Jul 2001 +0400 20010717 23:59:59
  5983. 18 Jul 2001 192115 20010718 19:21:15
  5984. 18 Jul 2001 192115.8 20010718 19:21:16
  5985. 18-Jul-2001T1921 20010718 19:21:00
  5986. 18-Jul-2001 1921Z 20010718 15:21:00
  5987. 18-Jul-2001 1921 GMT 20010718 15:21:00
  5988. 18-Jul-2001 1921 UTC 20010718 15:21:00
  5989. 18-Jul-2001 1921 Z 20010718 15:21:00
  5990. 18-Jul-2001 1921Z 20010718 15:21:00
  5991. 18-Jul-2001 1921 -04:00:00 20010718 19:21:00
  5992. 21-Jul-2001_08:20:00am 20010721 08:20:00
  5993. 21-Jul-2001_8:20:00P.M. 20010721 20:20:00
  5994. Fri Jul 20 11:26:25 2001 20010720 11:26:25
  5995. Fri Jul 20 11:26:25 GMT 2001 20010720 07:26:25
  5996. Sun, 9 Apr 2000 06:46:46 +0100 20000409 01:46:46
  5997. Sunday, 9 Apr 2000 06:46:46 +0100 20000409 01:46:46
  5998. now 20010731 19:41:12
  5999. today 20010731 00:00:00
  6000. today 09:00 20010731 09:00:00
  6001. tomorrow 20010801 00:00:00
  6002. tomorrow 09:00 20010801 09:00:00
  6003. tomorrow 09:00 GMT 20010801 05:00:00
  6004. yesterday 20010730 00:00:00
  6005. yesterday 09:00 20010730 09:00:00
  6006. + 3 days 20010803 00:00:00
  6007. +3 days 20010803 00:00:00
  6008. +3days 20010803 00:00:00
  6009. + 3days 20010803 00:00:00
  6010. + 3 days 09:00 20010803 09:00:00
  6011. + 2 weeks 20010814 00:00:00
  6012. + 1 month 20010831 00:00:00
  6013. - 7 months 20001231 00:00:00
  6014. + 10 years 20110731 00:00:00
  6015. friday 20010803 00:00:00
  6016. saturday 20010804 00:00:00
  6017. sunday 20010805 00:00:00
  6018. monday 20010806 00:00:00
  6019. tuesday 20010731 00:00:00
  6020. wednesday 20010801 00:00:00
  6021. thursday 20010802 00:00:00
  6022. friday 07:00 20010803 07:00:00
  6023. thursday 1:00pm 20010802 13:00:00
  6024. thursday 1:00pm GMT 20010802 09:00:00
  6025. Thu, 10 Nov 94 10:50:47 EST 19941110 10:50:47
  6026. Fri, 20 Oct 1995 18:35:15 -0400 (EDT) 19951020 18:35:15
  6027. 31/12/2001 20011231 00:00:00
  6028. 12/31/2001 20011231 00:00:00
  6029. 2001-July-20 20010720 00:00:00
  6030. 2001-September-30 20010930 00:00:00
  6031. 30-September-2001 20010930 00:00:00
  6032. Sep 30, 2001 12:34:56 20010930 12:34:56
  6033. September 30, 2001 20010930 00:00:00
  6034. September 30, 2001 630 20010930 06:30:00
  6035. September 30 2001 630 20010930 06:30:00
  6036. Sep-30-2001 12:34:59 20010930 12:34:59
  6037. 20010807113542.014 20010807 11:35.42
  6038. 20010807113542.014Z 20010807 07:35:42
  6039. 8.13.6. New Date-Time Functions
  6040. In the following descriptions, date-time function arguments are the
  6041. same free-format date-time strings discussed above, with the same
  6042. defaults for missing fields. They are automatically converted to
  6043. standard format internally prior to processing.
  6044. \fcvtdate(d1)
  6045. Converts the date-time d1 to standard format and local time.
  6046. This function is not new, but now it accepts a wider range of
  6047. argument formats that can include timezones and/or delta times.
  6048. If the first argument is omitted, the current date and time are
  6049. assumed. The optional second argument is a format code for the
  6050. result:
  6051. n1 = 1: yyyy-mmm-dd hh:mm:ss (mmm = English 3-letter month
  6052. abbreviation)
  6053. n1 = 2: dd-mmm-yyyy hh:mm:ss (ditto)
  6054. n1 = 3: yyyymmddhhmmss (all numeric)
  6055. \futcdate(d1)
  6056. Converts the date-time d1 to Universal Coordinated Time (UTC),
  6057. also known as GMT or Zulu or Zero-Meridian time. The default d1
  6058. is NOW. If d1 is a valid date-time, the UTC result is returned
  6059. in standard format, yyyymmdd hh:ss:mm.
  6060. \fcmpdates(d1,d2)
  6061. Compares two free-format date-times, d1 and d2, and, if both
  6062. arguments are valid, returns a number: -1 if d1 is earlier than
  6063. (before) d2; 0 if d1 is the same as d2; 1 if d1 is later than
  6064. (after) d2.
  6065. \fdiffdates(d1,d2)
  6066. Computes the difference between two free-format date-times, d1
  6067. and d2. If both arguments are valid, returns a delta time which
  6068. is negative if d1 is earlier than (before) d2 and positive
  6069. otherwise. If d1 and d2 are equal, the result is "+0:00".
  6070. Otherwise, the result consists of the number of days, hours,
  6071. minutes, and seconds that separate the two date-times. If the
  6072. number of days is zero, it is omitted. If the number of days is
  6073. nonzero but the hours, minutes, and seconds are all zero, the
  6074. time is omitted. if the seconds are zero, they are omitted.
  6075. \fdelta2secs(dt)
  6076. Converts a delta time to seconds. For example, "+1d00:00:01" to
  6077. 86401. Valid delta times must start with a + or - sign. Days are
  6078. accepted as time units, but not years, months, or weeks. If the
  6079. result would overflow a computer long word (as would happen with
  6080. 32-bit long words when the number of days is greater than
  6081. 24854), the function fails.
  6082. HINT: Although Kermit has a number of built-in date and time variables,
  6083. it doesn't have a single one suitable for writing a timestamp. For this
  6084. you would normally use something like "\v(ndate) \v(time)". But
  6085. \fcvtdate() (with no arguments) is equivalent: it returns the current
  6086. date and time in yyyymmdd hh:mm:ss format, suitable for time stamping.
  6087. 8.13.7. Date-Time Programming Examples
  6088. Here's a macro that converts any date-time to UTC, which you might use
  6089. if C-Kermit didn't already have a \futcdate() function:
  6090. define utcdate {
  6091. .local := \fcvtdate(\%*) ; 1.
  6092. .tmp := \fcvtdate(\m(local)UTC) ; 2.
  6093. .offset := \fdiffdate(\m(local),\m(tmp)) ; 3.
  6094. .utc := \fcvtdate(\m(local)\m(offset)) ; 4.
  6095. sho mac utc ; 5.
  6096. }
  6097. Brief explanation: Line 1 converts the macro argument, a free-format
  6098. date-time, to standard-format local time. Line 2 appends the "UTC"
  6099. timezone to the local time and converts the result to local time. In
  6100. other words, we take the same time as the local time, but pretend it's
  6101. UTC time, and convert it to local time. For example, if New York time
  6102. is 4 hours ahead of UTC, then 6:00pm New York time is 2:00pm UTC. Line
  6103. 3 gets the difference of the two results (e.g. "+04:00"). Line 4
  6104. appends the difference (delta time) to the local time, and converts it
  6105. again, which adds (or subtracts) the UTC offset to the given time. Line
  6106. 5 displays the result.
  6107. Here's a script that opens a web page, gets its headers into an array,
  6108. scans the array for the "Last-Modified:" header, and interprets it:
  6109. http open www.columbia.edu
  6110. if fail stop 1 HTTP OPEN failed
  6111. http /array:a head index.html /dev/null
  6112. if fail stop 1 HTTP GET failed
  6113. show array a
  6114. for \%i 1 \fdim(&a) 1 {
  6115. .\%x := \findex(:,\&a[\%i])
  6116. if not \%x continue
  6117. .tag := \fleft(\&a[\%i],\%x-1)
  6118. .val := \fltrim(\fsubstr(\&a[\%i],\%x+1))
  6119. if ( eq "\m(tag)" "Last-Modified" ) {
  6120. echo HTTP Date: \m(val)
  6121. .rdate := \fcvtdate(\m(val))
  6122. echo {Standard Date (local): \m(rdate)}
  6123. echo {Standard Date (UTC): \futcdate(\m(rdate))}
  6124. break
  6125. }
  6126. }
  6127. http close
  6128. The result:
  6129. HTTP Date: Mon, 13 Aug 2001 20:05:42 GMT
  6130. Standard Date (local): 20010813 16:05:42
  6131. Standard Date (UTC): 20010813 20:05:42
  6132. As you can see, Kermit had no trouble decoding the date-time-string
  6133. from the website, converting to local time, and converting back to UTC
  6134. with no conflicts or loss of information. If it had been in any other
  6135. known format, the result would have been the same.
  6136. Now suppose we want to download the web page only if it is newer than
  6137. our local copy. The \fdate(filename) function (which returns the
  6138. modification date-time of the given file) and the new \fcmpdates()
  6139. function make it easy. Insert the following just before the BREAK
  6140. statement:
  6141. if ( < 0 \fcmpdates(\m(rdate),\fdate(index.html)) ) {
  6142. echo GETTING index.html...
  6143. http get index.html index.html
  6144. if success echo HTTP GET OK
  6145. } else {
  6146. echo index.html: no update needed
  6147. }
  6148. http close
  6149. exit
  6150. This says, "if 0 is less than the comparison of the remote file date
  6151. and the local file date, get the remote file, otherwise skip it." And
  6152. it automatically reconciles the time-zone difference (if any).
  6153. It would be nice to be able to extend this script into a
  6154. general-purpose website updater, but unfortunately HTTP protocol
  6155. doesn't provide any mechanism for the client to ask the server for a
  6156. list of files, recursive or otherwise.
  6157. [ [483]Top ] [ [484]Contents ] [ [485]C-Kermit Home ] [ [486]Kermit
  6158. Home ]
  6159. 8.14. Trapping Keyboard Interruption
  6160. Normally when you type Ctrl-C and Kermit is in command mode (as opposed
  6161. to CONNECT mode) with COMMAND INTERRUPTION ON (as it is unless you have
  6162. set it OFF), Kermit interrupts any command that is currently in
  6163. progress, and if a command file or macro is executing, rolls the
  6164. command stack back to top level, closing all open command files,
  6165. deactivating all macros, deallocating all local variables and arrays,
  6166. and leaving you at the command prompt.
  6167. Suppose, however, you want certain actions to occur when a script is
  6168. interrupted; for example, closing open files, writing log entries, or
  6169. displaying summary results. You can do this by defining a macro named
  6170. ON_CTRLC. When Ctrl-C is detected, and a macro with this name is
  6171. defined, Kermit executes it from the current command level, thus giving
  6172. it full access to the environment in which the interruption occurred,
  6173. including local variables and open files. Only when the ON_CTRLC macro
  6174. completes execution is the command stack rolled back to top level.
  6175. Once the ON_CTRLC macro is defined, it can be executed only once. This
  6176. is to prevent recursion if the user types Ctrl-C while the ON_CTRLC
  6177. macro is executing. If you type Ctrl-C while the Ctrl-C macro is
  6178. active, this does not start a new copy of ON_CTRLC; rather, it returns
  6179. to the top-level command prompt. After the ON_CTRLC macro returns, it
  6180. has been removed from the macro table so if you want to use it again or
  6181. install a different Ctrl-C trap, you must execute a new DEFINE ON_CTRLC
  6182. command. In any case, as always when you interrupt a script with
  6183. Ctrl-C, its completion status is FAILURE.
  6184. Normally the ON_CTRLC macro would be defined in the command file or
  6185. macro to which it applies, and should be declared LOCAL. This way, if
  6186. the command file or macro completes successfully without being
  6187. interrupted, the ON_CTRLC definition disappears automatically.
  6188. Otherwise the definition would still be valid and the macro would be
  6189. executed, probably out of context, the next time you typed Ctrl-C.
  6190. Here's a simple example of a command file that sets a Ctrl-C trap for
  6191. itself:
  6192. local on_ctrlc ; Make Ctrl-C trap local to this command file.
  6193. define on_ctrlc { ; Define the ON_CTRLC macro.
  6194. echo Interrupted at \v(time).
  6195. echo Iterations: \%n
  6196. }
  6197. xecho Type Ctrl-C to quit
  6198. for \%n 1 999 1 { ; Prints a dot every second until interrupted.
  6199. sleep 1
  6200. xecho .
  6201. }
  6202. echo Finished normally at \v(time) ; Get here only if not interrupted.
  6203. decrement \%n
  6204. echo Iterations: \%n
  6205. This prints a summary no matter whether it completes normally or is
  6206. interrupted from the keyboard. In both cases the trap is automatically
  6207. removed afterwards.
  6208. For an example of how to use ON_CTRLC to debug scripts, see
  6209. [487]Section 8.1.
  6210. [ [488]Top ] [ [489]Contents ] [ [490]C-Kermit Home ] [ [491]Kermit
  6211. Home ]
  6212. 9. S-EXPRESSIONS
  6213. This section is primarily for those who want to write
  6214. calculation-intensive scripts, especially if they require
  6215. floating-point arithmetic, and/or for those who are familiar with the
  6216. LISP programming language.
  6217. Ever since C-Kermit version 5 was released in 1988, scripting has been
  6218. one of its major attractions, and arithmetic is a key part of it.
  6219. Versions 5 and 6 included integer arithmetic only, using traditional
  6220. algebraic notation, e.g.:
  6221. echo \fevaluate(3*(2+7)/2)
  6222. 13
  6223. C-Kermit 7.0 added support for floating-point arithmetic, but only
  6224. through function calls:
  6225. echo \ffpdivide(\ffpmultiply(3.0,\ffpadd(2.0,7.0)),2.0)
  6226. 13.5
  6227. C-Kermit 8.0 introduces a third form of arithmetic that treats integers
  6228. and floating-point numbers uniformly, is easier to read and write, and
  6229. executes very quickly:
  6230. (/ (* 3 (+ 2 7)) 2)
  6231. 13.5
  6232. But first some background.
  6233. The Kermit command and scripting language differs from true programming
  6234. languages (such as C or Fortran) in many ways; one of the most
  6235. prominent differences is the way in which variables are distinguished
  6236. from constants. In a command language, words are taken literally; for
  6237. example, the Unix shell:
  6238. cat foo.bar
  6239. displays the file named foo.bar. Whereas in a programming language like
  6240. C, words are assumed to be variables:
  6241. s = foo.bar; /* Assigns the value of foo.bar to the variable s */
  6242. To make a programming language take words literally, you have to quote
  6243. or "escape" them:
  6244. s = "foo.bar"; /* Assigns a pointer to the string "foo.bar" to the variable s
  6245. */
  6246. The opposite holds for command languages: to get them to treat a word
  6247. as a variable rather than a constant, you have to escape them. For
  6248. example, in the Unix shell:
  6249. foo=123 ; Assign value 123 to variable foo.
  6250. echo foo ; Prints "foo"
  6251. echo $foo ; Prints "123"
  6252. And in Kermit:
  6253. define foo 123 ; Assign value 123 to variable foo.
  6254. echo 123 ; This prints "123".
  6255. echo foo ; This prints "foo".
  6256. echo \m(foo) ; This prints "123".
  6257. In other words, character strings (such as "foo" above) are interpreted
  6258. as literal strings, rather than variable names, except in special
  6259. commands like DEFINE that deal specifically with variable names (or in
  6260. numeric contexts as explained in [492]Section 8.2). The special
  6261. "escape" character (dollar sign ($) for the shell, backslash (\) for
  6262. Kermit) indicates that a variable is to be replaced by its value.
  6263. The requirement to escape variable names in command languages normally
  6264. does not impose any special hardship, but can add a considerable
  6265. notational burden to arithmetic expressions, which are typically full
  6266. of variables. Especially in Kermit when floating point numbers are
  6267. involved, where you must use special \ffpxxx() functions, e.g.
  6268. "\ffpadd(\m(a),\m(b))" rather than the simple "+" operator to add two
  6269. floating-point numbers together, because the original arithmetic
  6270. handler doesn't support floating point (this might change in the
  6271. future). To illustrate, the general formula for the area of a triangle
  6272. is:
  6273. sqrt(s * (s - a) * (s - b) * (s - c))
  6274. where a, b, and c are the lengths of the triangle's three sides and:
  6275. s = (a + b + c) / 2
  6276. Except in special cases (e.g. a = 3, b = 4, c = 5), the result has a
  6277. fractional part so the computation must be done using floating-point
  6278. arithmetic. We can create a Kermit 7.0 function for this as follows:
  6279. def area {
  6280. local s t1 t2 t3
  6281. assign s \ffpdiv(\ffpadd(\ffpadd(\%1,\%2),\%3),2.0)
  6282. assign t1 \ffpsub(\m(s),\%1)
  6283. assign t2 \ffpsub(\m(s),\%2)
  6284. assign t3 \ffpsub(\m(s),\%3)
  6285. return \ffpsqrt(\ffpmul(\m(s),\ffpmul(\m(t1),\ffpmul(\m(t2),\m(t3)))))
  6286. }
  6287. But as you can see, this is rather cumbersome. Note, in particular,
  6288. that arithmetic functions like \ffpadd(), \ffpmul(), etc, take exactly
  6289. two operands (like their symbolic counterparts + and *), so obtaining
  6290. the product of three or more numbers (as we do in this case) is
  6291. awkward.
  6292. Using the alternative S-Expression notation, we can reduce this to a
  6293. form that is both easier to read and executes faster (the details are
  6294. explained later):
  6295. def newarea {
  6296. (let s (/ (+ \%1 \%2 \%3) 2.0))
  6297. (sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
  6298. }
  6299. In both examples, the \%1..3 variables are the normal Kermit macro
  6300. arguments, referenced by the normal escaping mechanism. For increased
  6301. readability, we can also assign the macro arguments \%1, \%2, and \%3
  6302. to the letters a, b, and c corresponding to our formula:
  6303. def newarea {
  6304. (let a \%1 b \%2 c \%3)
  6305. (let s (/ (+ a b c) 2.0))
  6306. (sqrt (* s (- s a) (- s b) (- s c)))
  6307. }
  6308. And now the Kermit function reads almost like the original formula.
  6309. Here Kermit behaves more like a regular programming language. In an
  6310. S-Expression, macro names need not be escaped when they are used as the
  6311. names of numeric variables.
  6312. [ [493]Top ] [ [494]Contents ] [ [495]C-Kermit Home ] [ [496]Kermit
  6313. Home ]
  6314. 9.1. What is an S-Expression?
  6315. The S-Expression concept is borrowed from the Lisp programming
  6316. language. "S-Expression" is short for Symbolic Expression (itself
  6317. sometimes shortened to SEXP). S-Expressions provide a kind of
  6318. Alternative Mini-Universe within the Kermit command language when the
  6319. regular rules don't apply, a universe enclosed in parentheses.
  6320. C-Kermit does not pretend to be a full Lisp interpreter; only the
  6321. arithmetic parts of Lisp have been incorporated: S-Expressions that
  6322. operate on numbers and return numeric values (plus extensibility
  6323. features described in [497]Section 9.8, which allow some degree of
  6324. string processing).
  6325. An S-Expression is a list of zero or more items, separated by spaces,
  6326. within parentheses. Examples:
  6327. ()
  6328. (1)
  6329. (a)
  6330. (+ a 1)
  6331. (* 2 a b)
  6332. If the S-Expression is empty, it has the NIL (empty) value. If it is
  6333. not empty and the first item is an operator (such as + or *), there can
  6334. be zero or more subsequent items, called the operands:
  6335. (+ 1 2)
  6336. Here the operator is "+" and the operands are "1" and "2", and the
  6337. value of the S-Expression is the value of the operation (in this case
  6338. 3). The operator always comes first, which is different from the
  6339. familiar algebraic notation; this because S-Expression operators can
  6340. have different numbers of operands:
  6341. (+ 1)
  6342. (+ 1 2)
  6343. (+ 1 2 3 4 5 6 7 8 9)
  6344. If the first item in the S-Expression is not an operator, then it must
  6345. be a variable or a number (or a macro; see [498]Section 9.8), and the
  6346. S-Expression can only contain one item; in this case, the
  6347. S-Expression's value is the value of the variable or number:
  6348. (a)
  6349. (3)
  6350. Operands can be numbers, variables that have numeric values, functions
  6351. that return numbers, or other S-Expressions. To illustrate an
  6352. S-Expression within an S-Expression, observe that:
  6353. (+ 1 2)
  6354. is equivalent to any of the following (plus an infinite number of
  6355. others):
  6356. (+ 1 (+ 1 1))
  6357. (+ (- 3 2) (/ 14 (+ 3 4)))
  6358. S-Expressions can be nested to any reasonable level; for example, the
  6359. value of the following S-Expression is 64:
  6360. (- (* (+ 2 (* 3 4)) (- 9 (* 2 2))) 6)
  6361. Operators have no precedence, implied or otherwise, since they can't be
  6362. mixed. The only exceptions are unary + and -, which simply indicate the
  6363. sign of a number:
  6364. (* 3 -1)
  6365. Order of evaluation is specified entirely by parentheses, which are
  6366. required around each operator and its operands: (+ a (* b c)) instead
  6367. of (a + b * c).
  6368. S-Expressions provide a simple and isolated environment in which
  6369. Kermit's macro names can be used without the \m(...) escaping that is
  6370. normally required. Given:
  6371. define a 1
  6372. define b 2
  6373. define c 3
  6374. Then:
  6375. (+ \m(a) \m(b) \m(c))
  6376. is equivalent to:
  6377. (+ a b c)
  6378. Within an S-Expression, as in other strictly numeric contexts
  6379. ([499]Section 8.2), any operand that starts with a letter is treated as
  6380. a Kermit macro name. In this context, abbreviations are not accepted;
  6381. variable names must be spelled out in full. Alphabetic case is not
  6382. significant; "a" and "A" are the same variable, but both are different
  6383. from "area".
  6384. Of course, regular Kermit variables and functions can be used in
  6385. S-Expressions in the normal ways:
  6386. (* \v(math_pi) (^ \%r 2)) ; Area of a circle with radius \%r
  6387. (+ \fjoin(&a)) ; Sum of all elements of array \&a[]
  6388. [ [500]Top ] [ [501]Contents ] [ [502]C-Kermit Home ] [ [503]Kermit
  6389. Home ]
  6390. 9.2. Integer and Floating-Point-Arithmetic
  6391. Normally, if all numbers in an S-Expression are integers, the result is
  6392. an integer:
  6393. (+ 1 1) ; Result is 2
  6394. (/ 9 3) ; Result is 3
  6395. If any of the operands is floating point, however, the result is also
  6396. floating point:
  6397. (+ 1 1.0) ; Result is 2.0
  6398. (/ 9.0 3) ; Result is 3.0
  6399. If all the operands are integers but the result has a fractional part,
  6400. the result is floating point:
  6401. (/ 10 3) ; Result is 3.333333333333333
  6402. To force an integer result in such cases, use the TRUNCATE operator:
  6403. (truncate (/ 10 3)) ; Result is 3
  6404. Similarly, to force a computation to occur in floating point, you can
  6405. coerce one of its operands to FLOAT:
  6406. (+ 1 (float 1)) ; Result is 2.0
  6407. The result is also floating point if the magnitude of any integer
  6408. operand, intermediate result, or the result itself, is larger than the
  6409. maximum for the underlying machine architecture:
  6410. (^ 100 100)
  6411. If the result is too large even for floating-point representation,
  6412. "Infinity" is printed; if it is too small to be distinguished from 0,
  6413. 0.0 is returned.
  6414. Large numbers can be used and large results generated, but they are
  6415. accurate only to the precision of the underlying machine. For example,
  6416. the result of:
  6417. (+ 111111111111111111111 222222222222222222222)
  6418. should be 333333333333333333333, but 333333333333333300000.0 is
  6419. produced instead if the machine is accurate to only about 16 decimal
  6420. digits, even with coercion to floating-point. The order of magnitude is
  6421. correct but the least significant digits are wrong. The imprecise
  6422. nature of the result is indicated by the ".0" at the end. Contrast
  6423. with:
  6424. (+ 111111111 222222222)
  6425. which produces an exact integer result.
  6426. [ [504]Top ] [ [505]Contents ] [ [506]C-Kermit Home ] [ [507]Kermit
  6427. Home ]
  6428. 9.3. How to Use S-Expressions
  6429. S-Expressions may be given as commands to C-Kermit. Any command whose
  6430. first character is "(" (left parenthesis) is interpreted as an
  6431. S-Expression.
  6432. If you enter an S-Expression at the C-Kermit> prompt, its result is
  6433. printed:
  6434. C-Kermit>(/ 10.0 3)
  6435. 3.333333333333333
  6436. C-Kermit>
  6437. If an S-Expression is executed within a macro or command file, its
  6438. value is not printed. However, you can control the printing action
  6439. with:
  6440. SET SEXPRESSION ECHO { AUTO, ON, OFF }
  6441. AUTO is the default, meaning print the value at top level only;
  6442. ON means always print the value; OFF means never print it.
  6443. In any case, the value of the most recent S-Expression (and the
  6444. S-Expression itself) may be accessed programmatically through the
  6445. following variables:
  6446. \v(sexpression)
  6447. The S-Expression most recently executed.
  6448. \v(svalue)
  6449. The value of the S-Expression most recently executed.
  6450. Besides issuing S-Expressions as commands in themselves, you can also
  6451. execute them anywhere within a Kermit command, but in this case they
  6452. must be enclosed in a function call (otherwise they are taken
  6453. literally):
  6454. \fsexpression(s)
  6455. The argument "s" is an S-Expression; the outer parentheses may
  6456. be omitted. The value of the S-Expression is returned. Note that
  6457. since S-Expressions usually contain spaces, some form of
  6458. grouping or quoting might be needed in some contexts:
  6459. echo \fsexpression((+ 1 1)) ; Outer parentheses may be included
  6460. echo \fsexpr(+ 1 1) ; Outer parentheses may be omitted
  6461. echo Value = "\fsexp(+ 1 a)" ; Can be embedded in strings
  6462. echo Value = \&a[\fsexp(/ b 2)] ; Can be used in array subscripts
  6463. if = {\fsexp(+ 1 1)} 2 { ; Braces needed here for grouping
  6464. echo One plus one still equals two
  6465. }
  6466. The IF statement illustrates how to use S-Expressions as (or in) IF or
  6467. WHILE conditions:
  6468. * Although S-Expressions and IF conditions are similar in appearance,
  6469. they are not interchangeable. Therefore you must use \fsexpr() to
  6470. let Kermit know it's an S-Expression rather than a regular IF
  6471. condition, or a boolean or algebraic expression within an IF
  6472. condition.
  6473. * In contexts where a single "word" is expected, you must enclose the
  6474. \fsexp() invocation in braces if the S-Expression contains spaces
  6475. (and most of them do).
  6476. If an S-Expression is the last command executed in a macro, its value
  6477. becomes the return value of the macro; no RETURN command is needed.
  6478. Example:
  6479. def newarea {
  6480. (let s (/ (+ \%1 \%2 \%3) 2.0))
  6481. (sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
  6482. }
  6483. This is equivalent to (but more efficient than):
  6484. def newarea {
  6485. (let s (/ (+ \%1 \%2 \%3) 2.0))
  6486. return \fsexp(sqrt (* s (- s \%1) (- s \%2) (- s \%3)))
  6487. }
  6488. When an S-Expression is entered as a command -- that is, the first
  6489. nonblank character of the command is a left parenthesis -- then it is
  6490. allowed to span multiple lines, as many as you like, until the first
  6491. left parenthesis is matched:
  6492. (let s (/
  6493. (+
  6494. \%1
  6495. \%2
  6496. \%3
  6497. )
  6498. 2.0
  6499. )
  6500. )
  6501. (sqrt (*
  6502. s
  6503. (- s \%1)
  6504. (- s \%2)
  6505. (- s \%3)
  6506. )
  6507. )
  6508. The S-Expression concept lends itself easily to embedding and
  6509. recursion, but the depth to which recursion can occur is limited by the
  6510. resources of the computer (memory size, address space, swap space on
  6511. disk) and other factors. There is no way that C-Kermit can know what
  6512. this limit is, since it varies not only from computer to computer, but
  6513. also from moment to moment. If resources are exhausted by recursion,
  6514. C-Kermit simply crashes; there's no way to trap this error. However,
  6515. you can set a depth limit on S-Expressions:
  6516. SET SEXPRESSION DEPTH-LIMIT number
  6517. Limits the number of times the S-Expression reader can invoke
  6518. itself without returning to the given number. The default limit
  6519. is 1000. This limit applies to S-Expressions embedded within
  6520. other S-Expressions as well as to S-Expressions that invoke
  6521. recursive macros. If the limit is exceeded, Kermit prints
  6522. "?S-Expression depth limit exceeded" and returns to its prompt.
  6523. More about recursion in [508]Section 9.8.
  6524. You can also test the depth programmatically:
  6525. \v(sdepth)
  6526. The current S-Expression invocation depth. The depth includes
  6527. both nesting level and recursion. For example, in:
  6528. (foo (foo (foo (foo (foo))))), the innermost (foo) is at depth
  6529. 5.
  6530. Help, completion, and syntax checking are not available within an
  6531. S-Expression. If you type ? within an S-Expression, it says:
  6532. C-Kermit>(? S-Expression ("help sexp" for details)
  6533. As it says, typing "help sexp" will display a brief help text.
  6534. The SHOW SEXPRESSION command displays current SET SEXPRESSION settings
  6535. and related information.
  6536. [ [509]Top ] [ [510]Contents ] [ [511]C-Kermit Home ] [ [512]Kermit
  6537. Home ]
  6538. 9.4. Summary of Built-in Constants and Operators
  6539. Three constants are built in:
  6540. * PI, whose value is the value of pi (the quotient of circumference
  6541. of any circle and its diameter, 3.141592653...) to the underlying
  6542. machine's precision;
  6543. * T, which always has the value 1, which signifies truth in Kermit
  6544. logical expressions or S-Expressions;
  6545. * NIL, which always has the empty value, and can serve as a False
  6546. truth value.
  6547. These constants are specific to S-Expressions and are not visible
  6548. outside them. They may not be used as the target of an assignment. So,
  6549. for example:
  6550. (setq t 0) Fails
  6551. assign t 0 Succeeds but this is not the same T!
  6552. E (the base of natural logarithms, 2.7182818184...) is not built in
  6553. since it is not intrinsic in most Lisp dialects. If you want E to be
  6554. the base of natural logarithms you can:
  6555. (setq e (exp 1))
  6556. Operators are either symbols (such as "+") or words. Words must be
  6557. spelled out in full, not abbreviated. Differences of alphabetic case
  6558. are ignored.
  6559. The most basic operation in S-Expressions is evaluation:
  6560. EVAL [ s-expression or variable or number [ another [ another ... ] ] ]
  6561. Evaluates its operands and returns the value of the last one
  6562. evaluated. Examples:
  6563. (eval) 0
  6564. (eval 1) 1
  6565. (eval a) value of a
  6566. (eval (+ 1 a)) value of a+1
  6567. (eval (setq a 1) (setq b (+ a 0.5))) value of b (= a+0.5)
  6568. You can use "." as a shorthand for EVAL:
  6569. (.)
  6570. (. 1)
  6571. (. a)
  6572. (. (+ 1 a))
  6573. (. (setq a 1) (setq b (+ a 0.5)))
  6574. Opposite of EVAL is the operator that suppresses evaluation of its
  6575. operand:
  6576. QUOTE item
  6577. The value (quote item) is "item". If the item is itself an
  6578. S-Expression, the result is the S-Expression with the outer
  6579. parentheses stripped. Examples:
  6580. (quote) (illegal)
  6581. (quote a) a
  6582. (quote hello) hello
  6583. (quote (this is a string)) this is a string
  6584. (quote this is a string) (illegal)
  6585. A shorthand notation is also accepted for quoting:
  6586. 'a is equivalent to (quote a). And therefore:
  6587. '(a b c) is equivalent to (quote (a b c)).
  6588. More about quoting in [513]Section 9.8.
  6589. STRING item
  6590. Is a combination of EVAL and QUOTE. It evaluates the item as an
  6591. S-Expression, and then puts quotes around the result (more about
  6592. this in [514]Section 9.8).
  6593. The following operators assign values to variables:
  6594. SETQ [ variable [ value [ variable [ value [ ... ] ] ] ] ]
  6595. Applies to global variables. For each variable given: if a value
  6596. is not given, the variable is undefined. If a value is given,
  6597. assigns the value to the variable. The value may be a number, a
  6598. variable, or anything that resolves to a number including an
  6599. S-Expression. Returns the value of the last assignment.
  6600. Examples:
  6601. (setq) Does nothing, returns NIL.
  6602. (setq a) Undefines a, returns NIL.
  6603. (setq a 1) Assigns 1 to a, returns 1.
  6604. (setq a 1 b 2) Assigns 1 to a, 2 to b, returns 2.
  6605. (setq a 1 b 2 c) Assigns 1 to a, 2 to b, undefines c, returns NIL.
  6606. To undefine a variable that is not the final one in the list, give it a
  6607. value of "()" or NIL:
  6608. (setq a () b 2) Undefines a, assigns 2 to b, returns 2.
  6609. (setq a nil b 2) Ditto.
  6610. Note that a variable can be used right away once it has a value:
  6611. (setq a 1 b a) Assigns 1 to a, the value of a (1) to b, returns 1.
  6612. The results of SETQ (when used with macro names) can be checked
  6613. conveniently with SHOW MACRO, e.g:
  6614. show mac a b c
  6615. LET [ variable [ value [ variable [ value [ ... ] ] ] ] ]
  6616. Like SETQ, but applies to local variables. Note that "local" is
  6617. used in the Kermit sense, not the Lisp sense; it applies to the
  6618. current Kermit command level, not to the current S-Expression.
  6619. If you want to use SETQ or LET to assign a value to a backslash
  6620. variable such as \%a or \&a[2], you must double the backslash:
  6621. (setq \\%a 3)
  6622. (setq \\%b (+ \%a 1))
  6623. (setq \\&a[2] (setq (\\%c (+ \%a \%b))))
  6624. In other words:
  6625. * Double the backslash when you want to indicate the variable's NAME;
  6626. * Don't double the backslash when you want its VALUE.
  6627. See [515]Section 9.6 for a fuller explanation of variable syntax and
  6628. scope.
  6629. Here's a summary table of arithmetic operators; in the examples, a is 2
  6630. and b is -1.3:
  6631. Operator Description Example Result
  6632. + Adds all operands (0 or more) (+ a b) 0.7
  6633. - Subtracts all operands (0 or more) (- 9 5 2 1) 1
  6634. * Multiplies all operands (0 or more) (* a (+ b 1) 3) -1.80
  6635. / Divides all operands (2 or more) (/ b a 2) -0.325
  6636. ^ Raise given number to given power (^ 3 2) 9
  6637. ++ Increments variables (++ a 1.2) 3.2
  6638. -- Decrements variables (-- a) 1
  6639. ABS Absolute value of 1 operand (abs (* a b 3)) 7.8
  6640. MAX Maximum of all operands (1 or more) (max 1 2 3 4) 4
  6641. MIN Minimum of all operands (1 or more) (min 1 2 3 4) 1
  6642. MOD (%) Modulus of all operands (1 or more) (mod 7 4 2) 1
  6643. FLOAT Convert an integer to floating-point (float 1) 1.0
  6644. TRUNCATE Integer part of floating-point operand (truncate 3.333) 3
  6645. CEILING Ceiling of floating-point operand (ceiling 1.25) 2
  6646. FLOOR Floor of floating-point operand (floor 1.25) 1
  6647. ROUND Operand rounded to nearest integer (round 1.75) 2
  6648. SQRT Square root of 1 operand (sqrt 2) 1.414..
  6649. EXP e (2.71828..) to the given power (exp -1) 0.367..
  6650. SIN Sine of angle-in-radians (sin (/ pi 2)) 1.0
  6651. COS Cosine of angle-in-radians (cos pi) -1.0
  6652. TAN Tangent of angle-in-radians (tan pi) 0.0
  6653. LOG Natural log (base e) of given number (log 2.7183) 1.000..
  6654. LOG10 Log base 10 of given number (log10 1000) 3.0
  6655. The ++ and -- operators are also assignment operators and work just
  6656. like SETQ and LET in their interpretations of operators and operands,
  6657. but:
  6658. * Each target variable must already be defined and have a numeric
  6659. value;
  6660. * The assignment value is the amount by which to increment or
  6661. decrement the variable.
  6662. * If an assignment value is not given, 1 is used.
  6663. If you include more than one variable-value pair in a ++ or --
  6664. expression, every variable (except, optionally, the last) must be
  6665. followed by a value. Examples:
  6666. (++ a) Equivalent to (setq a (+ a 1)) and to (++ a 1)
  6667. (++ a 2) Equivalent to (setq a (+ a 2))
  6668. (-- a (* 2 pi)) Equivalent to (setq a (- a (* 2 pi)))
  6669. (++ a 1 b 1 c 1 d) Equivalent to four SETQs incrementing a,b,c,d by 1.
  6670. Another group of operators forms the predicates. These return a "truth
  6671. value", in which 0 (or NIL) is false, and 1 or any other nonzero number
  6672. is true.
  6673. Operator Description Example Result
  6674. = (or ==) Operands are equal (= 1 1.0) 1
  6675. != Operands are not equal (!= 1 1.0) 0
  6676. < Operands in strictly ascending order (< 1 2 3) 1
  6677. <= Operands in ascending order (<= 1 1 2 3) 1
  6678. > Operands in strictly descending order (> 3 2 1) 1
  6679. >= Operands in descending order (<= 3 3 2 1) 1
  6680. AND (&&) Operands are all true (and 1 1 1 1 0) 0
  6681. OR (||) At least one operand is true (or 1 1 1 1 0) 1
  6682. XOR Logical Exclusive OR (xor 3 1) 0
  6683. NOT (!) Reverses truth value of operand (not 3) 0
  6684. The Exclusive OR of two values is true if one value is true and the
  6685. other value is false.
  6686. And another group operates on bits within an integer word:
  6687. Operator Description Example Result
  6688. & Bitwise AND (& 7 2) 2
  6689. | Bitwise OR (| 1 2 3 4) 7
  6690. # Bitwise Exclusive OR (# 3 1) 2
  6691. ~ Reverses all bits (~ 3) -4
  6692. These operators coerce their operands to integer by truncation if
  6693. necessary. The result of bit reversal is hardware dependent.
  6694. The final category of operator works on truth values:
  6695. Operator Description Example Result
  6696. IF Conditional evaluation (if (1) 2 3) 2
  6697. IF (predicate) (s1) [ (s2) ]
  6698. The IF operator is similar to Kermit's IF command. If the
  6699. predicate is true (i.e. evaluates to a nonzero number), the
  6700. first S-Expression (s1) is evaluated and its value is returned.
  6701. Otherwise, if (s2) is given, it is evaluated and its value
  6702. returned; if (s2) is not given, nothing happens and the NIL
  6703. (empty) value is returned.
  6704. You can group multiple expressions in the s1 and s2 expressions using
  6705. EVAL (or "."):
  6706. (if (< a 0) (eval (setq x 0) (setq y 0)) (eval (setq x a) (setq y b)))
  6707. or equivalently:
  6708. (if (< a 0) (. (setq x 0) (setq y 0)) (. (setq x a) (setq y b)))
  6709. Each operator has its own requirement as to number and type of
  6710. operands. In the following table, "number" means any kind of number --
  6711. integer or floating-point -- or a variable, function, macro, or
  6712. S-Expression that returns a number; "vname" means variable name,
  6713. "fpnumber" means a floating-point number (or anything that resolves to
  6714. one), and "integer" means integer (or anything that resolves to one).
  6715. "truthvalue" means anything that resolves to a value of zero or an
  6716. empty value (which indicates false) or a nonzero value (which indicates
  6717. true). "any" means any kind of value, including none at all.
  6718. Operator Number of operands Type of operands Returns
  6719. EVAL (.) 0 or more S-Expression Last value (default NIL)
  6720. STRING 1 S-Expression string
  6721. QUOTE (') 1 word string
  6722. SETQ 0 or more vname value pairs Last value (default NIL)
  6723. LET 0 or more vname value pairs Last value (default NIL)
  6724. + 0 or more number number (default 0)
  6725. - 0 or more number number (default 0)
  6726. * 0 or more number number (see note (1))
  6727. / 2 or more number number
  6728. ^ 2 or more number number
  6729. ++ 1 or more vname value pairs Result of last increment
  6730. -- 1 or more vname value pairs Result of last decrement
  6731. ABS 1 number number
  6732. MAX 1 or more number number
  6733. MIN 1 or more number number
  6734. MOD (%) 2 number number
  6735. FLOAT 1 number fpnumber
  6736. TRUNCATE 1 number integer
  6737. CEILING 1 number integer
  6738. FLOOR 1 number integer
  6739. ROUND 1 number integer
  6740. SQRT 1 number fpnumber
  6741. EXP 1 number fpnumber
  6742. SIN 1 number fpnumber
  6743. COS 1 number fpnumber
  6744. TAN 1 number fpnumber
  6745. LOG 1 number fpnumber
  6746. LOG10 1 number fpnumber
  6747. = (==) 1 or more number truthvalue
  6748. != 1 or more number truthvalue
  6749. < 1 or more number truthvalue
  6750. <= 1 or more number truthvalue
  6751. > 1 or more number truthvalue
  6752. >= 1 or more number truthvalue
  6753. AND (&&) 1 or more truthvalue truthvalue
  6754. OR (||) 1 or more truthvalue truthvalue
  6755. XOR 2 truthvalue truthvalue
  6756. NOT (!) 1 truthvalue truthvalue
  6757. & 1 or more number (see note 2) integer
  6758. | 1 or more number (see note 2) integer
  6759. # 2 number (see note 2) integer
  6760. ~ 1 number (see note 2) integer
  6761. IF 2 or 3 truthvalue,any,any any
  6762. Operators that don't require any arguments return the default values
  6763. shown.
  6764. 1. The value of "*", when used as an operand, is initially "1" and the
  6765. value of the most recent S-Expression thereafter, as in Franz Lisp.
  6766. This is handy when doing a series of calculations by hand:
  6767. C-Kermit>(* 13272.42 0.40)
  6768. 5308.968
  6769. C-Kermit>(/ * 2)
  6770. 2654.4840
  6771. C-Kermit>
  6772. 2. The bitwise operators coerce their operands to integer by
  6773. truncation.
  6774. [ [516]Top ] [ [517]Contents ] [ [518]C-Kermit Home ] [ [519]Kermit
  6775. Home ]
  6776. 9.5. Variables
  6777. As noted elsewhere in this discussion, all backslash items (variables
  6778. such as \%a, macro parameters such as \%1, array elements such as
  6779. \&a[\%i], built-in variables such as \v(ndate), built-in functions such
  6780. as \fjoin(), macro names enclosed in \m(), \s(), or \:(), etc) are
  6781. evaluated at "top level" before the S-Expression is sent to the
  6782. S-Expression reader. To use a backslash variable as the target of an
  6783. assignment (e.g. by SETQ, LET, ++, or --), you must double the
  6784. backslash, e.g. (setq \\%r 1234). This is discussed at greater length
  6785. in the next section.
  6786. Thus S-Expression reader generally deals only with macro names (not
  6787. backslash items) as variables. It is important to understand how the
  6788. reader handles macro names. There are fundamentally two kinds of
  6789. S-Expressions: those that contain a single element, such as:
  6790. (foo)
  6791. and those that contain more than one element:
  6792. (foo a b c)
  6793. If an S-Expression contains only one element, and it is the name of a
  6794. macro, the macro's definition is examined. If the definition is a
  6795. number (integer or floating-point, positive or negative), then this
  6796. becomes the value of the expression. If the definition starts with '
  6797. (apostrophe), then the quoted word or string is the value of the
  6798. expression (explained in [520]Section 9.8). Otherwise, the macro is
  6799. assumed to be composed of Kermit commands (possibly including
  6800. S-Expressions), which are executed. If the macro has a RETURN value, or
  6801. it executes an S-Expression as its last command, the result becomes the
  6802. value of the S-Expression; otherwise the result is empty.
  6803. For S-Expressions that contain more than one element, and the first
  6804. element is the name of a macro, then this macro is executed with the
  6805. arguments that are given, after the arguments are evaluated by the
  6806. S-Expression reader. Likewise, If the first element is a built-in
  6807. operator, then it is applied to the operands after they are evaluated.
  6808. In both cases, each operand is fed to the S-Expression reader
  6809. recursively for evaluation. If an operand is a number or a quoted
  6810. string, it is used as-is. But if it's a macro name, this degenerates
  6811. into the first case, and the previous paragraph applies.
  6812. Examples:
  6813. define foo 123
  6814. (foo) Result: 123
  6815. define foo 'abc
  6816. (foo) Result: abc
  6817. define foo '(one two three)
  6818. (foo) Result: one two three
  6819. define foo return \frandom(1000)
  6820. (foo) Result: 713 (or other number)
  6821. define foo (+ a b)
  6822. (foo) Result: The sum of a and b
  6823. A more difficult example:
  6824. define foo abc
  6825. (foo) Result: ???
  6826. The result in the last example depends on the definition of abc:
  6827. * If it has no definition, an error occurs; otherwise:
  6828. * If the definition is an S-Expression, the result is the
  6829. S-Expression's value; otherwise:
  6830. * If the definition consists of Kermit commands, they are executed.
  6831. But in this case "(foo)" produces the empty result, because it
  6832. doesn't RETURN anything.
  6833. The use of macros as S-Expression operators is described in
  6834. [521]Section 9.8.
  6835. [ [522]Top ] [ [523]Contents ] [ [524]C-Kermit Home ] [ [525]Kermit
  6836. Home ]
  6837. 9.6. Assignments and Scope
  6838. The assignment operators SETQ and LET apply to global and local
  6839. variables, respectively. SETQ and LET are standard Lisp operators
  6840. adapted to Kermit scoping rules. When the operands are numeric or
  6841. arithmetic, SETQ is equivalent to Kermit's EVALUATE command:
  6842. (setq a (+ 1 2))
  6843. evaluate a 1 + 2
  6844. When the operand is a string, SETQ is equivalent to DEFINE:
  6845. (setq a '(this is a string))
  6846. define a this is a string
  6847. In the first case, both statements create a macro named "a" with a
  6848. value of 3. But in neither case is the macro "a" necessarily global. If
  6849. either of these commands executes in an environment (i.e. macro
  6850. invocation level) where a "local a" command has been given, the "a"
  6851. macro is global to that environment, but is not visible outside it.
  6852. LET is equivalent to the Kermit LOCAL command, followed by the
  6853. corresponding EVALUATE:
  6854. (let a (+ 1 2))
  6855. is equivalent to:
  6856. local a
  6857. evaluate a 1 + 2
  6858. Again, "local" in this context applies to the Kermit macro invocation
  6859. stack, not to the S-Expression nesting level. To illustrate, recall our
  6860. "newarea" macro:
  6861. def newarea {
  6862. (let a \%1 b \%2 c \%3)
  6863. (let s (/ (+ a b c) 2.0))
  6864. (sqrt (* s (- s a) (- s b) (- s c)))
  6865. }
  6866. Because SETQ and LET expressions return a value, they can be placed
  6867. within a larger S-Expression. In this case we can replace the first
  6868. reference to the "s" variable by its defining expression:
  6869. def newarea {
  6870. (let a \%1 b \%2 c \%3)
  6871. (sqrt (* (let s (/ (+ a b c) 2.0)) (- s a) (- s b) (- s c)))
  6872. }
  6873. This would not work if LET were local to the S-Expression, but it works
  6874. nicely in the context of Kermit macros. The previous definition is
  6875. equivalent to:
  6876. def newarea {
  6877. local a b c s
  6878. (setq a \%1 b \%2 c \%3)
  6879. (sqrt (* (setq s (/ (+ a b c) 2.0)) (- s a) (- s b) (- s c)))
  6880. }
  6881. In both cases, the variables a, b, c, and s are local to the "newarea"
  6882. macro, and global within it.
  6883. Multiple assignments can be handled in several ways. Here is the
  6884. obvious way to initialize a series of variables to the same value:
  6885. (setq a 0)
  6886. (setq b 0)
  6887. (setq c 0)
  6888. (setq s 0)
  6889. Here is a more compact and efficient way of doing the same thing:
  6890. (setq a 0 b 0 c 0 s 0)
  6891. However, in case the value was more complex, it's better to put only
  6892. one copy of it in the S-Expression; in this case we rely on the fact
  6893. that SETQ returns the value of its last assignment:
  6894. (setq a (setq b (setq c (setq s (* x (^ y 2))))))
  6895. Similarly, to set a series of variables to x, x+1, x+2, ...
  6896. (setq c (+ (setq b (+ (setq a (+ (setq s x) 1)) 1)) 1))
  6897. In the last example, you can see why "last" does not always correspond
  6898. to "rightmost" (the leftmost variable "c" is assigned last).
  6899. If you are working with backslash variables like \%a or array elements
  6900. like \&a[1], remember two rules:
  6901. 1. Don't put spaces inside array brackets.
  6902. 2. You must double the backslash when using SETQ, LET, ++, or -- to
  6903. assign a value to a backslash variable.
  6904. Examples of assigning to a backslash variable:
  6905. (setq x 1)
  6906. (setq \\%a 0)
  6907. (setq \\&a[x+1] 1)
  6908. (++ \\%x)
  6909. (-- \\&a[x+2])
  6910. Examples of referring to a backslash variable's value:
  6911. (setq a (+ \%a 1))
  6912. (setq b (+ \%a \&a[1]))
  6913. (++ a \%x)
  6914. (-- b \&a[1])
  6915. The special notation is required because all backslashed items (\%x
  6916. variables, array elements, built-in \v(xxx) variables, and \fxxx()
  6917. function invocations) are evaluated in a single pass BEFORE the
  6918. S-Expression is executed; any other approach would result in
  6919. unacceptable performance. So, for example, in:
  6920. declare \&a[] = 1 2 3
  6921. define \%x 4
  6922. define \%y 0
  6923. (setq \\%y (+ \%x \&a[1]))
  6924. the S-Expression becomes:
  6925. (setq \%y (+ 4 1))
  6926. before it is sent to the S-Expression evaluator. If the backslash had
  6927. not been doubled on the assignment target, the result would have been:
  6928. (setq 0 (+ 4 1))
  6929. which is illegal because you can't assign a value to a number.
  6930. Conversely, if backslashes were doubled on right-hand-side values:
  6931. (setq \\%y (+ \\%x \\&a[1])
  6932. this too, would give an error (not numeric - "\%x").
  6933. If you omit the double backslash in the assignment target, the result
  6934. depends on whether the variable already has a value:
  6935. (setq \%a (* 3 3))
  6936. If \%a has a non-numeric single-word value, then this becomes the name
  6937. of the variable that is assigned by SETQ. To illustrate:
  6938. define \%a foo
  6939. echo \%a
  6940. foo
  6941. (setq \%a (* 3 3))
  6942. echo \%a
  6943. foo
  6944. show macro foo
  6945. foo = 9
  6946. If \%a has no value, a numeric value, or a multiword value, an "invalid
  6947. assignment" error occurs.
  6948. [ [526]Top ] [ [527]Contents ] [ [528]C-Kermit Home ] [ [529]Kermit
  6949. Home ]
  6950. 9.7. Conditional Expressions
  6951. The IF operator provides a compact form of decision-making within
  6952. S-Expressions. An IF expression can stand wherever a number might
  6953. stand, as long is it returns a number. Here's a quick way to obtain the
  6954. average value of all the elements in an array that contains only
  6955. numbers:
  6956. (/ (+ \fjoin(&a)) (float \fdim(&a)))
  6957. This results in a "Divide by zero" error if the array is empty. If you
  6958. want to define the average value of an empty array to be 0 instead of
  6959. getting an error, you can use IF to check the array size:
  6960. (if \fdim(&a) (/ (+ \fjoin(&a)) (float \fdim(&a))) 0)
  6961. or equivalently:
  6962. (if (not \fdim(&a)) 0 (/ (+ \fjoin(&a)) (float \fdim(&a))))
  6963. Of course, IF can fit anywhere else into an S-Expression:
  6964. (setq a (+ b (if (< c 0) 0 c)))
  6965. and the IF expression can be as complex as you like:
  6966. (setq a (+ b (if (and (or (> x 0) (> y 0)) (< c 0) (> d 1) (!= e 0)) 1 0)))
  6967. and the "then" and "else" parts can contain multiple S-Expressions
  6968. enclosed within (EVAL ...):
  6969. (if x (eval (...) (...) (...)) (eval (...) (...) (...)))
  6970. AND and OR operators are guaranteed to "short circuit". If any operand
  6971. of AND is false, none of the subsequent operands is evaluated;
  6972. likewise, if an OR operand is true, no further operands are evaluated.
  6973. Bear in mind that the S-Expression IF is not the same as Kermit IF; the
  6974. condition is only allowed to be an S-Expression or a variable or
  6975. number, not the whole list of possibilities you see when you type "if
  6976. ?" at the C-Kermit> prompt. But keep reading...
  6977. [ [530]Top ] [ [531]Contents ] [ [532]C-Kermit Home ] [ [533]Kermit
  6978. Home ]
  6979. 9.8. Extensibility
  6980. To extend the capabilities of S-Expressions, you can use Kermit macro
  6981. names as operators, with the following limitations:
  6982. * The macro must not have the same name as a built-in operator.
  6983. * You must use the full macro name, not an abbreviation.
  6984. And with the following enhancement:
  6985. * If the last statement executed by the macro is an S-Expression, its
  6986. value is returned automatically. In other words:
  6987. define bump (++ \%1)
  6988. is equivalent to:
  6989. define bump return \fsexpression(++ \%1)
  6990. Here's an example in which we define a FIBONACCI operator that returns
  6991. the nth element, n >= 0, of the Fibonacci series, 0 1 1 2 3 5 8 13 21
  6992. 34 55, . . ., in which the first element is 0, the second is 1, and
  6993. each subsequent element is the sum of the two before it. This series
  6994. was devised by Leonardo Pisano, Filius Bonacci (Fibonacci for short) in
  6995. 1202 to describe how fast rabbits can breed, and also forms the basis
  6996. for the Golden Mean, the branching behavior of plants, the spiral of a
  6997. nautilus shell, etc. (Thanks to [534]Dat Thuc Nguyen for December 2003
  6998. corrections to this section!)
  6999. We can write a FIBONACCI function as a macro easily with S-Expressions:
  7000. define FIBONACCI {
  7001. (if (== \%1 0) 0
  7002. (if (== \%1 1) 1 (+ (fibonacci (- \%1 2)) (fibonacci (- \%1 1)))))
  7003. }
  7004. You can read this as:
  7005. If the argument (\%1) is 0, return a result of 0; if it is 1,
  7006. return 1; otherwise:
  7007. return the sum of fibonacci(argument - 2) and fibonacci(argument -
  7008. 1)
  7009. Note that a RETURN statement is not needed, since S-Expressions
  7010. automatically set the return value of their containing macros.
  7011. For comparison, here's how it would be coded without S-Expressions:
  7012. define FIBONACCI {
  7013. if == \%1 0 {
  7014. return 0
  7015. } else if == \%1 1 {
  7016. return 1
  7017. } else {
  7018. return \feval(\fexec(fibonacci \feval(\%1-2)) -
  7019. + \fexec(fibonacci \feval(\%1-1)))
  7020. }
  7021. }
  7022. Now we can use the FIBONACCI function (whichever way you write it) just
  7023. as if it were a built-in operator:
  7024. (fibonacci 6)
  7025. Or:
  7026. (setq a 10)
  7027. (fibonacci a)
  7028. Within S-Expressions only (not outside them), S-Expressions themselves
  7029. can be used as macro arguments:
  7030. (setq a 2 b 4)
  7031. (setq x (fibonacci (* a b )))
  7032. The value of the S-Expression (in this case "8"), and not the
  7033. S-Expression itself, is sent to the macro.
  7034. Your macro is responsible for argument validation and error handling. A
  7035. robust Fibonacci macro would be more like this:
  7036. define FIBONACCI {
  7037. if < \v(argc) 2 end 1 ?\%0: Missing argument
  7038. if > \v(argc) 2 end 1 ?\%0: Too many arguments
  7039. if not integer \%1 end 1 ?\%0: Integers only
  7040. if < \%1 1 end 1 ?\%0: Argument out of range
  7041. (if (== \%1 0) 0
  7042. (if (== \%1 1) 1 (+ (fibonacci (- \%1 2)) (fibonacci (- \%1 1)))))
  7043. }
  7044. Recall that "END nonzero-number [ message ]" causes a macro invocation
  7045. to fail. When the macro is the operator in an S-Expression, this makes
  7046. the S-Expression fail too. Also note that our Fibonacci macro is just
  7047. an illustration, not a practical example. Since it is recursive (calls
  7048. itself), it won't work for large arguments because the call stack can
  7049. exceed available memory. See [535]Section 9.9.2 for a practical
  7050. alternative.
  7051. Kermit macros, when used as S-Expression operators, can do anything at
  7052. all except initiate file transfers: they can print messages on the
  7053. screen, read and write files, interact with the user, and so on. For
  7054. example, here's a macro ASKME that asks you to enter a number, makes
  7055. sure that you did, and then returns its value for use in the
  7056. S-Expression:
  7057. define ASKME {
  7058. local \%n
  7059. while true {
  7060. ask \%n { Number: }
  7061. if not def \%n continue
  7062. if not numeric \%n {
  7063. echo Not numeric - "\%n"
  7064. continue
  7065. }
  7066. break
  7067. }
  7068. return \%n
  7069. }
  7070. (setq a (* 2 (askme))) ; Get number from user, double it, assign result to a.
  7071. Here's a macro you can use to validate that a number is in a given
  7072. range:
  7073. define inrange {
  7074. if != \v(argc) 4 end 1 ?\%0: Wrong number of arguments
  7075. if ( < \%1 \%2 || > \%1 \%3 ) return 0
  7076. return 1
  7077. }
  7078. The first argument is the number to be checked, the second is the
  7079. minimum acceptable value, the third is the maximum. You can use this
  7080. (for example) in IF conditions:
  7081. define yes echo \%1 IS OK
  7082. define no echo \%1 IS NOT OK
  7083. (setq a -1 b 999)
  7084. (if (inrange a 0 100) (yes a) (no a))
  7085. (if (inrange b -1000 +1000) (yes b) (no b))
  7086. This is just an illustration, of course; there's already a built-in
  7087. operator to let you do range checking without help from macros:
  7088. (if (<= 0 a 100) (yes a) (no a))
  7089. (if (<= -1000 b +1000) (yes b) (no b))
  7090. To send string parameters to a macro, some kind of quoting is required
  7091. to tell the S-Expression parser to take a given "word" literally rather
  7092. than replacing it by its value. For this we use the Lisp QUOTE
  7093. operator:
  7094. define length return \flength(\%1)
  7095. (length (quote abcdefghijklmnopqrstuvwxyz))
  7096. 26
  7097. This causes the string "abcdefghijklmnopqrstuvwxyz" to be sent
  7098. literally to the LENGTH macro. Kermit, like Lisp, also offers a
  7099. shortcut for QUOTE, that lets us quote a word by prefixing it with a
  7100. single quote (') character, also called apostrophe (ASCII 39):
  7101. (length 'abcdefghijklmnopqrstuvwxyz)
  7102. 26
  7103. The two forms are equivalent.
  7104. How the macro treats its arguments is up to the macro. In the example
  7105. above, the argument is treated as a literal string. However, it can
  7106. also be treated as a variable name:
  7107. define string This is a string
  7108. define length return \flength(\m(\%1))
  7109. (length 'string)
  7110. 16
  7111. Note the construct \m(\%1). This means "the value of the macro whose
  7112. name is the value of
  7113. \%1". The value of \%1 in this case is the word "string", and the value
  7114. of the macro whose name is "string" is "This is a string".
  7115. What if the macro takes multiple arguments, or a variable number of
  7116. them? Here's a simple macro that prints a phrase that includes its
  7117. arguments:
  7118. define complain echo It's too \%*!
  7119. (Recall that \%* means "all arguments".)
  7120. It can be called in the traditional way:
  7121. complain hot Result: "It's too hot!"
  7122. complain cold and wet Result: "It's too cold and wet!"
  7123. Or from an S-Expression if you quote the arguments:
  7124. (complain 'hot) Result: "It's too hot!"
  7125. (complain 'cold 'and 'wet) Result: "It's too cold and wet!"
  7126. To group multiple words into a single argument, use parentheses:
  7127. (complain (quote (cold and wet))) Result: "It's too cold and wet!"
  7128. (complain '(cold and wet)) Result: "It's too cold and wet!"
  7129. Note the difference:
  7130. (complain 'cold 'and 'wet) Three arguments
  7131. (complain '(cold and wet)) One argument
  7132. Since the COMPLAIN macro uses \%* to refer to all its arguments, no
  7133. matter how many, it doesn't care which form you use. But it makes a
  7134. difference in cases where the macro refers to its arguments
  7135. individually.
  7136. To illustrate, let's consider a macro that receives the name of a macro
  7137. and its argument list and executes it with its arguments, without
  7138. knowing how many arguments there are. The following LOOP macro is used
  7139. to execute the given macro with the given argument list the requested
  7140. number of times:
  7141. def loop { local i, for i 1 \%1 1 do \%2 \%3 }
  7142. Within the LOOP macro, the first argument (\%1) is the loop count, \%2
  7143. is the macro name, and \%3 is the argument list. When the LOOP macro is
  7144. invoked traditionally like this:
  7145. loop 3 complain hot
  7146. it prints "It's too hot!" three times. To invoke it from an
  7147. S-Expression, you must quote both the macro name as well as the
  7148. argument, since in this case the macro name itself is an argument:
  7149. (loop 3 'complain 'hot)
  7150. Now what if you need to send different or variable numbers of arguments
  7151. to the LOOP macro? The LOOP macro can handle it already, provided you
  7152. group the arguments into LOOP's third argument (\%3). In Kermit syntax,
  7153. without grouping:
  7154. loop 3 complain cold and wet
  7155. prints "It's too cold!" three times ("and wet" is lost); but with
  7156. grouping (either of the following two forms):
  7157. loop 3 complain {cold and wet}
  7158. loop 3 complain "cold and wet"
  7159. the LOOP macro prints "It's too cold and wet!" three times as desired.
  7160. To do the same thing in an S-Expression, just use the Lisp forms of
  7161. quoting instead of the Kermit forms; the following two are equivalent:
  7162. (loop 3 'complain (quote (cold and wet)))
  7163. (loop 3 'complain '(cold and wet))
  7164. Here's a similar example in which we write a macro that shows both the
  7165. name and the value of one or more other macros, whose names are given
  7166. as arguments (similar to "show macro"):
  7167. define display {
  7168. local \%i
  7169. for \%i 1 \v(argc)-1 1 {
  7170. echo \&_[\%i] = \m(\&_[\%i])
  7171. }
  7172. }
  7173. (Recall that \&_[] is the macro's argument vector array, equivalent to
  7174. \%1, \%2, ...) The DISPLAY macro can be used in S-Expressions like
  7175. this:
  7176. (setq a 1 b 2 c 3)
  7177. (display 'a 'b 'c 'd)
  7178. which prints:
  7179. a = 1
  7180. b = 2
  7181. c = 3
  7182. d =
  7183. The names must be quoted to prevent their evaluation before they are
  7184. sent to the macro. This ability to pass variables "by name" to macros,
  7185. rather than by value, lets you write macros that change the values of
  7186. argument variables. For example, here's a macro that doubles the value
  7187. of its argument variable:
  7188. define double (++ \%1 \%1)
  7189. which you can call like this:
  7190. (setq a 12)
  7191. (double 'a)
  7192. In the macro, \%1 is replace by the variable name "a"; "(++ a a)" adds
  7193. "a" to itself, and sets the value of "a" to the result.
  7194. There are no built-in operators other than QUOTE, ', and STRING for
  7195. handling strings in S-Expressions, but using just these, plus macros
  7196. that use Kermit's regular string-handling features, you can easily
  7197. extend S-Expressions to do string manipulation:
  7198. define len return \flen(\%1) Returns length of argument string
  7199. define cap return \fupper(\%1) Uppercase argument string
  7200. define rev return \freverse(\%1) Reverses argument string
  7201. define sub return \fsubstr(\%1,\%2,\%3) Returns substring of arg string
  7202. (len '(this is a string)) Result: 16
  7203. (rev '(this is a string)) Result: gnirts a si siht
  7204. (rev (cap '(this is a string))) Result: GNIRTS A SI SIHT
  7205. (sub (rev (cap '(this is a string))) 5 9) Result: TS A SI S
  7206. You can assign a string to a macro name as follows:
  7207. (setq foo '(this is a string))
  7208. (setq foo (quote (this is a string)))
  7209. The two are exactly equivalent. In both cases, the macro "foo" has the
  7210. value:
  7211. '(this is a string)
  7212. so when it is retrieved it can be identified as a string rather than a
  7213. number or commands to be executed. Thus:
  7214. (setq foo (quote (this is a string)))
  7215. show macro foo
  7216. foo = '(this is a string)
  7217. (foo)
  7218. this is a string
  7219. Note the different results for "show macro foo" and "(foo)". The former
  7220. shows the internal definition; the latter evaluates the variable, which
  7221. removes the quoting. And perhaps more important, note that if the
  7222. apostrophe and surrounding parentheses were not stored as part of the
  7223. definition, (foo) would try to execute "this is a string" as a command.
  7224. Given the assignment above, the following work as expected:
  7225. (len foo) Result: 16
  7226. (rev foo) Result: gnirts a si siht
  7227. (rev (cap foo)) Result: GNIRTS A SI SIHT
  7228. (sub (rev (cap foo)) 5 8) Result: TS A SI S
  7229. Note that, unlike built-in S-Expression operators that return numbers
  7230. or truth values, these operators return strings. If you want to assign
  7231. their return values to other variables, you can do so:
  7232. (setq bar (rev (cap foo))) Result: GNIRTS A SI SIHT
  7233. But now the S-Expression processor doesn't know the value of "bar" is
  7234. supposed to be a string, rather than a macro to execute. For this you
  7235. need one final special operator, STRING. The STRING operator takes an
  7236. S-Expression as an operand, evaluates it, and then returns its value
  7237. enclosed in '(), so you can use the value as a string is subsequent
  7238. S-Expressions. Use STRING for referencing macros that return strings:
  7239. (setq bar (string (rev (cap foo)))) Result: '(GNIRTS A SI SIHT)
  7240. STRING is like QUOTE, except that it evaluates its operand before
  7241. applying the quoting, rather than taking the operand literally.
  7242. To reference backslash variables or functions that return string
  7243. values, you must use the regular quoting mechanisms:
  7244. (setq time '(\v(time)))
  7245. (setq date '(\v(date)))
  7246. assign \%r this is a string
  7247. (setq s1 '(\%r))
  7248. That's because backslash items are evaluated BEFORE the S-Expression
  7249. parser ever sees them, and the values of \v(time) and so on are not
  7250. valid S-Expressions, so STRING won't like them.
  7251. Finally a brief word on the touchy topic of quoting. Suppose you want
  7252. to include (say) literal parentheses in a string that will later be
  7253. processed by the S-Expression reader (or \fsplit() or \fword()).
  7254. Normally, you can't do this because parentheses are meaningful in these
  7255. contexts. To defeat the normal parsing rules, you can quote the
  7256. parentheses with backslash. However, due to the many levels of string
  7257. processing involved, a surprisingly large amount of backslashes might
  7258. be required, for example:
  7259. (setq s '(a b (c d) \\\\\\\\\\\\\\\\(e f (g h) x\\\\\\\\\\\\\\\\) j k))
  7260. This is nearly impossible to explain(*). Instead, just remember two
  7261. points:
  7262. * In situations like this, it's better to use DEFINE to create the
  7263. string, rather than SETQ. The example above requires only double
  7264. backslashes when DEFINE is used:
  7265. define s '(a b (c d) \\(e f (g h) x\\) j k)
  7266. * The level of quoting depends on how many levels of evaluation the
  7267. string must pass through, which is not always obvious. However, the
  7268. number of backslashes required in any given situation is always a
  7269. power of 2. So if 1 doesn't work, try 2; if 2 doesn't work, try 4;
  7270. if 4 doesn't work, try 8, 16, 32, and so on.
  7271. Considerations like this apply in any scripting language (shell, Tcl,
  7272. Perl, Python, etc). The situation is known as "Quoting Hell".
  7273. (*) If you really want an explanation, here it is:
  7274. * Every SEXP has its backslash items evaluated in a single pass at
  7275. top level before being passed to the SEXP reader, so \%1,
  7276. \v(ftime), etc, can be evaluated up front, freeing the SEXP reader
  7277. of having to know about such things, which in turn makes it much
  7278. more efficient. Therefore one level of quoting is lost right away,
  7279. and therefore you must double each backslash that is to be used as
  7280. a quote.
  7281. * When the SEXP reader sees '\', it treats it as a quote; discards it
  7282. and keeps the next character. Thus '\\' becomes '\'. This would be
  7283. the end of it, except that:
  7284. * The SEXP reader must call itself recursively on its operands, so we
  7285. must double any quotes in the operands: 2^2 = 4.
  7286. * If the result is to be passed as an argument to a macro, the
  7287. backslashes must again be doubled, because the macro processor
  7288. evaluates the arguments before sending them to the macro: 2^3 = 8.
  7289. * If the macro itself is to see the quotes, rather than just the
  7290. result of the quoting, the quotes must be doubled again: 2^4 = 16.
  7291. Moral: To create string constants in which grouping characters must be
  7292. quoted, use DEFINE rather than SETQ.
  7293. [ [536]Top ] [ [537]Contents ] [ [538]C-Kermit Home ] [ [539]Kermit
  7294. Home ]
  7295. 9.9. Examples
  7296. 9.9.1. Statistics
  7297. The following program computes statistics -- means, maxima, minima,
  7298. variance, standard deviation, and correlation -- from data stored in
  7299. parallel arrays, \&x[] and \&y[], which can contain any mixture of
  7300. integer and floating-point numbers: positive, negative, or zero. Array
  7301. setup and validation are not shown. Except for the traditional FOR loop
  7302. and printing the results at the end, the entire computation is done
  7303. with S-Expressions:
  7304. ; Initialize sums, maxima, minima, and number of elements
  7305. (setq xsum 0 ysum 0 xsum2 0 ysum2 0 xysum 0)
  7306. (setq xmin (setq xmax \&x[1]) ymin (setq ymax \&y[1]))
  7307. (setq n \fdim(&x))
  7308. ; Loop through elements and accumulate sums, maxima, and minima
  7309. for i 1 n 1 {
  7310. (setq x \&x[i] y \&y[i]) ; Notational convenience
  7311. (setq xmax (max xmax x) ymax (max ymax y)) ; X and Y maxima
  7312. (setq xmin (min xmin x) ymin (min ymin y)) ; X and Y minima
  7313. (++ xsum x ysum y) ; X and Y sums
  7314. (++ xsum2 (^ x 2) ysum2 (^ y 2)) ; Sum of X and Y squares
  7315. (++ xysum (* x y)) ; Sum of XY products
  7316. }
  7317. ; Calculate results
  7318. (setq xmean (/ xsum n) ymean (/ ysum n)) ; Mean X and Y
  7319. (setq xss (- xsum2 (/ (^ xsum 2) n))) ; Intermediate values
  7320. (setq yss (- ysum2 (/ (^ ysum 2) n)))
  7321. (setq xyss (- xysum (/ (* xsum ysum) n)))
  7322. (setq xvar (/ xss n) yvar (/ yss n)) ; X and Y variance
  7323. (setq sdx (sqrt xvar) sdy (sqrt yvar)) ; Std deviation in X and Y
  7324. (setq tmp (* xss yss))
  7325. (setq cc (if tmp (/ xyss (sqrt tmp)) 1.0)) ; Correlation coefficient
  7326. show macro xmean ymean xvar yvar sdx sdy cc ; Print the results
  7327. The final "if tmp" check accounts for the possibility that both arrays
  7328. contain all 0's. Results can also be printed with "echo CC = \m(cc)",
  7329. or any other desired way. Interestingly, if we had not needed the sum
  7330. of the squares and products, we could have obtained the sums, maxima,
  7331. and minima of the X's and Y's without a loop like this:
  7332. (setq xsum (+ \fjoin(&x)) ysum (+ \fjoin(&y)))
  7333. (setq xmax (max \fjoin(&x)) ymax (max \fjoin(&y)))
  7334. (setq xmin (min \fjoin(&x)) ymin (min \fjoin(&y)))
  7335. Any Kermit function that returns numbers or lists of numbers can be
  7336. included in an S-Expression as an operand.
  7337. 9.9.2. Practical Fibonacci Series
  7338. The recursive Fibonacci example given previously is simple and elegant,
  7339. but not very useful since it causes memory occupation to grow each time
  7340. it calls itself, until eventually both physical memory and disk swap
  7341. space are filled and the program crashes. Even for small arguments,
  7342. like 17, execution time can be prohibitive:
  7343. (setq t1 \v(ftime))
  7344. (setq result (fibonacci 17))
  7345. (setq t2 (- \v(ftime) t1))
  7346. echo FIBONACCI(17) = \m(result): TIME = \ffpround(t2,3)
  7347. prints (on a certain rather slow computer):
  7348. FIBONACCI(17) = 1597: TIME = 5.861
  7349. Any recursive function can be recoded iteratively. The result is not as
  7350. pretty, but execution is far less expensive:
  7351. define FIBITER {
  7352. (if (== \%3 0) (\%2) (fibiter (+ \%1 \%2) \%1 (- \%3 1)))
  7353. }
  7354. define FIBONACCI {
  7355. (fibiter 1 0 \%1)
  7356. }
  7357. Here's the result on the same computer for the same argument of 17:
  7358. FIBONACCI(17) = 1597: TIME = 0.015
  7359. (47 times faster.) Execution time increases proportionally to the size
  7360. of the argument in the iterative case, whereas in the recursive case it
  7361. goes up geometrically, quickly reaching infinity.
  7362. [ [540]Top ] [ [541]Contents ] [ [542]C-Kermit Home ] [ [543]Kermit
  7363. Home ]
  7364. 9.10. Differences from Algebraic Notation
  7365. In C-Kermit:
  7366. * Algebraic notation uses infix operators and normal rules of
  7367. operator precedence, with parentheses used to force exceptions to
  7368. the rules; many operations can be included in an expression.
  7369. S-Expressions use prefix operators with no intrinsic precedence;
  7370. each operation is enclosed in parentheses, and the arrangement of
  7371. parentheses determines precedence.
  7372. * Algebraic infix operators require two operands; S-Expression prefix
  7373. operators can accept a variable number of operands.
  7374. * You can use algebraic notation anywhere that C-Kermit accepts a
  7375. number, e.g. "echo \&a[((1+1)*2-1]", but you can use S-Expressions
  7376. only as top-level commands. You can, however, use either algebraic
  7377. or S-Expressions anywhere at all by enclosing them in \fevaluate()
  7378. or \fsexpression(), respectively.
  7379. * You can use any mixture of integer and floating-point numbers in
  7380. S-Expressions, but only integers are permitted in algebraic
  7381. expressions. Outside of S-Expressions, floating point arithmetic is
  7382. supported only by \ffp...() function calls.
  7383. * Operators and operands in S-Expressions must be separated by
  7384. spaces, e.g. "(+ a b)". Spaces are not required in algebraic
  7385. expressions: "((a+b)*c)".
  7386. * When assigning values to backslash variables (such as \%x or
  7387. \&a[2]) using SETQ or LET, you must double the backslash.
  7388. [ [544]Top ] [ [545]Contents ] [ [546]C-Kermit Home ] [ [547]Kermit
  7389. Home ]
  7390. 9.11. Differences from Lisp
  7391. * Kermit has a lot of built-in operators not found in Lisp: ++, ^,
  7392. etc.
  7393. * Most dialects of real Lisp do not allow S-Expressions that don't
  7394. start with an operator, for example:
  7395. (a)
  7396. This expression can cause an error in Lisp (even if "a" has a
  7397. value), but is acceptable in Kermit, where it returns the value of
  7398. the variable "a". Similarly, (1) returns the value "1".
  7399. * In real Lisp, EVAL requires exactly one operand. In Kermit, it can
  7400. have 0, 1, 2, or more operands. It returns the value of the last
  7401. operand evaluated.
  7402. * Real Lisp SETQ and LET usually require an even number of operands.
  7403. Kermit allows an odd number, in which case the last (or only)
  7404. variable is undefined (i.e. deleted, destroyed).
  7405. * Kermit does not support ratios such as "7/8". Some Lisp dialects
  7406. accept ratios as numbers, and generate ratios when told to divide
  7407. two integers whose quotient is not a whole number; e.g. in Common
  7408. Lisp:
  7409. [13] USER(37): (/ (+ 1 2 3 4) 3)
  7410. 10/3
  7411. [13] USER(38):
  7412. * The result of (/ 10 3) is 3.333.... Some Lisp dialects truncate the
  7413. result to 3 since both operands are integers, some don't; some give
  7414. the result as a ratio. C-Kermit always gives a floating point
  7415. result when there is a fractional part. If you want an integer
  7416. result, you can use TRUNCATE, FLOOR, or CEILING, e.g. (truncate (/
  7417. 10 3)).
  7418. * There is currently no "bignum" support. Large numbers can be used
  7419. and large results generated, but (as noted in [548]Section 9.2)
  7420. they are accurate only to the precision of the underlying machine.
  7421. \v(math_precision) gives the machine precision as a number of
  7422. decimal digits, e.g. 16.
  7423. * Scientific notation for floating-point numbers is not supported. If
  7424. the magnitude of a number is greater than the precision of the
  7425. underlying hardware, the less-significant digits are shown but
  7426. their values are meaningless. If it the number is too small to be
  7427. represented internally, it is shown as "0.0".
  7428. * Many Lisp features are omitted: List processing (CAR, CDR, etc),
  7429. DEFUN, Lisp-specific control structures, and so on.
  7430. [ [549]Top ] [ [550]Contents ] [ [551]C-Kermit Home ] [ [552]Kermit
  7431. Home ]
  7432. 10. FILE TRANSFER
  7433. New commands and switches:
  7434. SET TRANSFER REPORT { OFF, ON }
  7435. Enables or disables the (new) one-line message printed by Kermit
  7436. after a remote-mode file transfer to indicate the source and
  7437. destination file, complete with path, to let you know where the
  7438. file went.
  7439. SEND /TYPE:{TEXT,BINARY}
  7440. Sends only files of the given type (see [553]Section 4).
  7441. SEND /NOFOLLOWLINKS:
  7442. (UNIX only) Skip over symbolic links rather than following them
  7443. (default). This applies to wildcard and/or recursive SENDs; if a
  7444. single filename is given, and it happens to be a symbolic link,
  7445. the file it points to is sent.
  7446. SEND /FOLLOWLINKS:
  7447. (UNIX only) Follow (resolve) symbolic links. Watch out for
  7448. circular links, endless loops, etc.
  7449. SET SEND I-PACKETS { OFF, ON }
  7450. When sending commands to a Kermit server, this tells whether
  7451. command packets should be preceded by an I (information) packet,
  7452. which is used to synchronize parameters prior to executing the
  7453. command. Normally ON. The only reason to set this OFF is for
  7454. communicating with buggy Kermit servers that misbehave when an I
  7455. packet is sent to them. There is also a SET RECEIVE I-PACKETS
  7456. command, but presently it has no effect.
  7457. SET TRANSFER MESSAGE [ text ]
  7458. Sets an initial message to be shown in the Last Message field of
  7459. the fullscreen file-transfer display.
  7460. SET TRANSFER TRANSLATION { ON, OFF }
  7461. Inhibits or re-enables text-file transfer character-set
  7462. translation globally.
  7463. { SEND, MSEND, GET, RECEIVE } /TRANSPARENT
  7464. Inhibits character-set translation for this transfer only.
  7465. { GET, RECEIVE } /PIPES:{ON,OFF}
  7466. Overrides global TRANSFER PIPES setting for this transfer only;
  7467. ON allows incoming files with names like "!tar xf -" to be
  7468. opened as pipelines rather than regular files.
  7469. The following new "hot keys" are available when Kermit's file-transfer
  7470. display is visible:
  7471. D: Turn on debugging, open "debug.log" if not already open.
  7472. d: Turn off debugging but leave log open (if it was open).
  7473. T: Turn on debug-log timestamps.
  7474. t: Turn off debug-log timestamps.
  7475. Other improvements:
  7476. * SET FILE DOWNLOAD-DIRECTORY now works for external protocols (e.g.
  7477. sz/rz) too.
  7478. * Improved automatic per-file text/binary switching, described in
  7479. [554]Section 4.
  7480. * When sending a file group (e.g. "send *.*"), failure to open a file
  7481. is no longer fatal; now C-Kermit simply goes ahead to the next
  7482. file.
  7483. * Transaction log entries are now made for external protocols too.
  7484. [ [555]Top ] [ [556]Contents ] [ [557]C-Kermit Home ] [ [558]Kermit
  7485. Home ]
  7486. 11. MODEMS AND DIALING
  7487. In C-Kermit 8.0, the default modem type for dialing has changed from
  7488. NONE (= DIRECT, meaning no modem) to GENERIC. This change should have
  7489. no impact on direct connections. For dialing, it means that, unless you
  7490. SET MODEM TYPE to a specific type, such as USROBOTICS or CONEXANT,
  7491. Kermit assumes:
  7492. 1. The modem uses the Hayes AT command set.
  7493. 2. The modem supports error correction, data compression, and hardware
  7494. flow control and is already configured to use them.
  7495. In fact, Kermit assumes the modem is completely configured, and
  7496. therefore does not send it an initialization string or any
  7497. configuration commands. Instead, it sends only the simplest and most
  7498. portable commands:
  7499. ATQ0V1 Give dial result codes.
  7500. ATDTnumber Dial the number.
  7501. (or ATD or ATDP, as appropriate).
  7502. The new defaults work for direct connections and for most modern modems
  7503. on most platforms, and they work much faster than "full-treatment"
  7504. dialing. If the new defaults don't work for you, or if you need to
  7505. perform explicit modem configurations or interactions, then set a
  7506. specific modem type and use the SET MODEM and SET DIAL commands as
  7507. documented in Using C-Kermit.
  7508. WARNING: Don't use the generic modem on hosts that do not support
  7509. RTS/CTS flow control. If Xon/Xoff is in use on the serial port,
  7510. you'll need to select a particular modem type so Kermit knows what
  7511. command to give it to enable Xon/Xoff flow control between itself
  7512. and your serial port.
  7513. The following new modem types were added in C-Kermit 8.0:
  7514. lucent: Lucent Venus chipset
  7515. pctel: PCTel V.90 chipset
  7516. conexant: Conexant (ex-Rockwell) modem family
  7517. zoom-v32bis: New name for "Zoom"
  7518. zoom-v34 Zoom V.34
  7519. zoom-v90 Zoom V.90 56K
  7520. zoom-v92: Zoom V.92 with V.44 data compression
  7521. zoltrix-v34: New name for "zoltrix"
  7522. zoltrix-hsp-v90: Synonym for PCTel
  7523. zoltrix-hcf-v90: Synonym for ITU-T-V250
  7524. smartlink-v90: Synonym for usrobotics (same chipset)
  7525. acer-v90: Synonym for Rockwell-v90
  7526. New DIAL-related variables:
  7527. \v(dm_hf): Dial modifier: Wait for Hook-Flash.
  7528. \v(dm_wb): Dial modifier: Wait for Bong.
  7529. Finally, if dialing fails, Kermit now prints a context-sensitive hint
  7530. suggesting possible reasons and remedies.
  7531. Added in C-Kermit 8.0.201: Rudimentary support for Caller ID, for use
  7532. with the ANSWER command. If the modem reports Caller ID information,
  7533. Kermit stores it in variables that you can access after the call is
  7534. answered:
  7535. \v(callid_date) The date of the call
  7536. \v(callid_time) The time of the call
  7537. \v(callid_name) The name of the caller
  7538. \v(callid_nmbr) The telephone number of the caller
  7539. \v(callid_mesg) A message
  7540. The format of these items depends on the originating and answering
  7541. phone companies and the modems and their configuration.
  7542. Not very many modems support Caller ID, and those that do (a) tend to
  7543. have it disabled by default, and (b) use different commands to enable
  7544. it. A quick survey shows of some current models shows:
  7545. - USR V.90: No
  7546. - ITU-T V.250: No
  7547. - Lucent Venus: No
  7548. - Diamond Supra: #CID=1
  7549. - Rockwell 56K: #CID=1
  7550. - PCTEL: #CID=1
  7551. - Zoltrix: +VCID=1
  7552. - Conexant: +VCID=1
  7553. To use Kermit's Caller ID feature, you have to set the modem to wait
  7554. for at least two rings before answering, and you have to give the
  7555. command to enable Caller ID; for example (after choosing a modem with
  7556. SET MODEM TYPE):
  7557. set modem command autoanswer on ATS0=2#CID=1\{13}
  7558. set modem command autoanswer on ATS0=2+VCID=1\{13}
  7559. These commands can be undone with:
  7560. set modem command autoanswer on ATS0=1#CID=0\{13}
  7561. set modem command autoanswer on ATS0=1+VCID=0\{13}
  7562. Kermit presently has no built-in knowledge of the Caller ID
  7563. capabilities or commands of the modems in its database.
  7564. Since the variables can be accessed only after the call is answered,
  7565. the only way to refuse a call is to answer it, inspect the variables,
  7566. and then hang it up if desired.
  7567. [ [559]Top ] [ [560]Contents ] [ [561]C-Kermit Home ] [ [562]Kermit
  7568. Home ]
  7569. 12. TERMINAL CONNECTION
  7570. Now that 7-bit connections are no longer the norm, the default terminal
  7571. bytesize (also called "data size" or "word size") in C-Kermit 8.0 is 8
  7572. bits, rather than 7 bits as it was in C-Kermit 7.0 and earlier:
  7573. SET ESCAPE character
  7574. This command, which specifies your CONNECT-mode escape
  7575. character, allows you to specify any ASCII control character in
  7576. a variety of formats. C-Kermit 8.0.201 now also lets you specify
  7577. any 8-bit value, 128-255, as the escape character. In the SET
  7578. ESCAPE command, you can type the 8-bit character literally or
  7579. you can enter its numeric code. Here are examples that you can
  7580. enter from a terminal or console that uses the ISO Latin-1
  7581. character set:
  7582. C-Kermit> set escape Ã
  7583. C-Kermit> set escape 195
  7584. C-Kermit> show escape
  7585. Escape character: Code 195 (Ã): enabled
  7586. C-Kermit>
  7587. Both of these commands set the escape character value to 195
  7588. (decimal), which happens to be uppercase letter A with Tilde in
  7589. Latin-1. SHOW ESCAPE and SHOW TERMINAL show the value, as does
  7590. the CONNECT message.
  7591. SET TERMINAL AUTODOWNLOAD ERROR { STOP, CONTINUE }
  7592. When Kermit has a terminal connection to another computer, and a
  7593. file transfer is initiated automatically because a Kermit packet
  7594. was received in CONNECT mode (i.e. in the terminal screen), this
  7595. command tells what Kermit should do if the transfer fails. The
  7596. default is to STOP, which leaves Kermit in command mode with its
  7597. file-transfer display showing, so you can see that the transfer
  7598. failed and why. If you SET TERMINAL AUTODOWNLOAD ERROR CONTINUE,
  7599. this causes Kermit to return automatically to its terminal
  7600. screen (i.e. resume its CONNECT session) as if the transfer had
  7601. succeeded; this can be desirable if the entire session is under
  7602. control of a host-based script.
  7603. SET TERMINAL BYTESIZE { 7, 8 }
  7604. The byte size to use during CONNECT and INPUT command execution,
  7605. which can be more restrictive than the bytesize implied by the
  7606. current PARITY setting, but not less restrictive. In C-Kermit
  7607. 7.0 and earlier, the terminal bytesize was 7 by default to
  7608. protect against the likelihood that parity was in use on the
  7609. connection without the user's knowledge. When the terminal
  7610. bytesize is 8 (as it is in C-Kermit 8.0 and later), the user
  7611. will see garbage in this (increasingly unlikely) situation. Note
  7612. that 8 data bits are required for most character sets other than
  7613. ASCII: Latin-1, UTF-8, and so on.
  7614. A new command has been added to produce timestamped session logs:
  7615. SET TERMINAL SESSION-LOG TIMESTAMPED-TEXT
  7616. Records the terminal session in text mode (like SET TERMINAL
  7617. SESSION-LOG TEXT) but adds a timestamp at the beginning of each
  7618. line. The timestamp format is hh:mm:ss.nnn, and indicates the
  7619. time at which the first character of the line appeared.
  7620. In most UNIX versions (those built with the select()-capable CONNECT
  7621. module -- pretty much all the ones that have or could have TELNET
  7622. included), an idle timeout feature has been added:
  7623. SET TERMINAL IDLE-TIMEOUT number
  7624. If the number is not 0, then Kermit is to take an action when
  7625. the given amount of time passes with no activity during CONNECT
  7626. mode. If the number is positive it is the maximum number of idle
  7627. seconds; if number is negative it represents milliseconds
  7628. (thousandths of seconds). If 0 is given as the number, there are
  7629. no idle timeouts. Synonym: SET TERMINAL IDLE-LIMIT.
  7630. SET TERMINAL IDLE-ACTION { RETURN, HANGUP, EXIT, OUTPUT [ string ] }
  7631. The action to be taken upon an idle timeout in CONNECT mode.
  7632. RETURN to the prompt, HANGUP the connection, EXIT from Kermit,
  7633. or OUTPUT the given string (if no string is given, a NUL (ASCII
  7634. 0) character is sent).
  7635. SET TERMINAL IDLE-ACTION { TELNET-NOP, TELNET-AYT }
  7636. Actions that can be selected on Telnet connections only, that
  7637. might be useful if idle limits are enforced by the Telnet server
  7638. or in the TCP/IP protocol: TELNET-NOP sends a "NO Operation"
  7639. (do-nothing) command, which causes no response from the server;
  7640. TELNET-AYT sends an "Are You There" message to the server, which
  7641. should make the server send back a message. Neither of these
  7642. actions interferes with your remote session.
  7643. SET TERMINAL IDLE-ACTION is useful for connections to hosts or services
  7644. that automatically log you out after a certain amount of idle time,
  7645. e.g.:
  7646. set term idle-timeout 300
  7647. set term idle-action output \32
  7648. sends a space (as if you had pressed the space bar) every 300 seconds
  7649. (five minutes) while there is no activity (32 is the ASCII code for
  7650. space).
  7651. When C-Kermit returns from CONNECT to command mode, the reason for the
  7652. transition is given in a new variable, \v(cx_status):
  7653. 0 No CONNECT command given yet.
  7654. 1 User escaped back manually.
  7655. 2 A trigger string was encountered.
  7656. 3 IKSD entered server mode.
  7657. 4 Application Program Command received from host.
  7658. 5 Idle timeout.
  7659. 6 Telnet protocol error.
  7660. 7 Keystroke macro.
  7661. 8 Time limit exceeded.
  7662. 100 Internal error.
  7663. 101 Carrier required by not detected.
  7664. 102 I/O error on connection.
  7665. 103 Disconnected by host.
  7666. 104 Disconnected by user.
  7667. 105 Session limit exceeded.
  7668. 106 Rejected due to Telnet policy.
  7669. 107 Received kill signal.
  7670. Values 100 and above indicate there is no connection.
  7671. [ [563]Top ] [ [564]Contents ] [ [565]C-Kermit Home ] [ [566]Kermit
  7672. Home ]
  7673. 13. CHARACTER SETS
  7674. See the section on [567]file scanning above, and the section on
  7675. character-set conversion in [568]FTP. Also:
  7676. * True support for CP1252 (rather than treating it as Latin-1).
  7677. * Proper handling of C1 values when converting ISO 8-bit text to
  7678. UTF-8.
  7679. * TYPE /CHARACTER-SET: /TRANSLATE-TO: allows specific translations.
  7680. * The TRANSLATE command now works on multiple files.
  7681. * K_CHARSET environment variable to set the file character-set.
  7682. * SET TRANSFER TRANSLATION OFF.
  7683. * FTP client character-set translation ([569]Section 3.7).
  7684. [ [570]Top ] [ [571]Contents ] [ [572]C-Kermit Home ] [ [573]Kermit
  7685. Home ]
  7686. 14. DIALOUT FROM TELNET TERMINAL SERVERS
  7687. For years, C-Kermit has supported dialing out from Telnet modem servers
  7688. (also called reverse terminal servers or access servers), but until now
  7689. there was no way for Kermit to control the communication parameters
  7690. (speed, parity, etc) on the serial port of the terminal server; it had
  7691. to use whatever was there.
  7692. But now, if you make a connection to a server that supports the Telnet
  7693. Com Port Control Option, [574]RFC 2217, you have the same degree of
  7694. control as you would have over a serial port on the computer where
  7695. Kermit is running: SET SPEED, SET FLOW, SET PARITY, SET STOP-BITS, SHOW
  7696. COMM, WAIT, SET CARRIER-WATCH, the modem-signal variables, sending
  7697. Break, and so on, apply to the connection between the terminal server
  7698. and the modem.
  7699. For example, using a Cisco Access Server 2509, where specifying a TCP
  7700. port in the 6000's selects a serial port that can be used for dialing
  7701. out:
  7702. set host xxx 6001 ; xxx is the IP hostname or address of the server
  7703. (log in if necessary) ; With a script or by hand
  7704. set modem type usr ; Tell Kermit what kind of modem it has
  7705. set speed 57600 ; This affects the server's port
  7706. set flow rts/cts ; Ditto
  7707. dial 7654321
  7708. The modem server might or might not require a login sequence. It might
  7709. also allow for automatic authentication, e.g. via Kerberos tickets.
  7710. NOTE: If the modem server requires a login sequence, then REDIAL might
  7711. not work as expected.
  7712. When you have a Telnet Com Port connection, your SET SPEED and SET FLOW
  7713. options change automatically to reflect the capabilities of the server,
  7714. rather than those of your local computer.
  7715. See the configuration manual for your server for additional
  7716. information. For example, how to set up the server to drop the Telnet
  7717. connection automatically when the telephone call is hung up (e.g.
  7718. "autohangup" on Cisco models).
  7719. For a Linux-based Telnet Com-Port server, click the Sredird link:
  7720. [ [575]Top ] [ [576]Contents ] [ [577]Sredird ] [ [578]C-Kermit Home ]
  7721. [ [579]Kermit Home ]
  7722. 15. COPING WITH BROKEN KERMIT PARTNERS
  7723. There are lots of faulty Kermit protocol implementations out there,
  7724. found mainly in 3rd-party products ranging from communications software
  7725. packages to file-transfer functions embedded within devices. This topic
  7726. is covered [580]HERE for C-Kermit 7.0, but C-Kermit 8.0 adds some
  7727. additional tricks.
  7728. SET ATTRIBUTE RECORD-FORMAT { ON, OFF }
  7729. Allows control of the Kermit's Record-Format attribute. Set this
  7730. to OFF in case incoming file are refused due to unknown or
  7731. invalid record formats if you want to accept the file anyway.
  7732. SET ATTRIBUTES OFF
  7733. This is not a new trick, but it was recently discovered that the
  7734. Kermit implementation embedded within a certain kind of
  7735. punching/bending machine (Salvagnini if you must know) hangs
  7736. upon reception of standard format Kermit attributes when
  7737. receiving files. When sending files, it sends attributes of its
  7738. own, one per A-packet, which is slightly unusual but legal. When
  7739. receiving files from C-Kermit, K95, MS-DOS Kermit, Kermit-370,
  7740. etc, it simply exits upon reception of the first A-packet;
  7741. apparently it was not coded according to the protocol
  7742. specification, which allows multiple attributes per A-packet.
  7743. Solution: tell the file sender to SET ATTRIBUTES OFF.
  7744. SET SEND I-PACKETS { ON, OFF }
  7745. A Kermit server is supposed to accept I-packets; this is how the
  7746. client lets the server know its capabilities and preferences
  7747. before sending a command. Apparently there is at least one
  7748. Kermit server implementation that does not accept I-packets, and
  7749. does not properly respond with an Error packet if it gets one.
  7750. To get around such situations in C-Kermit 8.0, you can use SET
  7751. SEND I-PACKETS OFF to inhibit the sending of I packets. In this
  7752. case, the client must be able to adjust to the server's
  7753. configuration, rather than the other way around as we are used
  7754. to.
  7755. SET PROTOCOL KERMIT {} {} {}
  7756. C-Kermit 6.0 and later automatically send "autoupload" and
  7757. "autodownload" commands when in local mode and you give a file
  7758. transfer command. For example, if you tell kermit to "send
  7759. oofa.txt", Kermit sends "kermit -r" and a carriage return, in
  7760. case you had forgotten to start Kermit on the far end and told
  7761. it to receive a file. If a Kermit program had already been
  7762. started on the far end, it should harmlessly absorb this string.
  7763. However, some Kermit programs violate the Kermit protocol
  7764. definition and treat such strings as Kermit packets even though
  7765. they are not. In such cases, give this command to set the Kermit
  7766. protocol autoupload and download strings to nothing, which tells
  7767. Kermit not to send them. (This is not a new feature, but it was
  7768. not previously included in the "Coping" section of the
  7769. documentation.)
  7770. [ [581]Top ] [ [582]Contents ] [ [583]C-Kermit Home ] [ [584]Kermit
  7771. Home ]
  7772. 16. NEW COMMAND-LINE OPTIONS
  7773. kermit -h Now prints a complete listing of its command-line options,
  7774. rather than an abbreviated list squeezed into a 24x80 space.
  7775. -dd Debug, like -d but adds timestamps
  7776. --version Shows C-Kermit version number.
  7777. --noperms Equivalent to SET ATTRIBUTE PROTECTION OFF.
  7778. Kermit now accepts a selection of URLs (Universal Resource Locators) as
  7779. its first command-line argument. These are:
  7780. telnet:hostname
  7781. Makes a Telnet connection to the given host (IP hostname or
  7782. address).
  7783. ftp://[user[:password]@]hostname[/path...]
  7784. Makes an FTP connection to the given host (IP hostname or
  7785. address). If a username is given, Kermit tries to log you in; if
  7786. a password is given, it is used; if not, you are prompted for
  7787. one. If no username is given, an anonymous login is performed.
  7788. If a pathname is included, Kermit tries to GET the given file.
  7789. See [585]Section 3.1.3 for details.
  7790. ftps://[user[:password]@]hostname[/path...]
  7791. Makes a secure FTP connection over SSL.
  7792. telnets://[user[:password]@]hostname
  7793. Makes a secure Telnet connection over SSL.
  7794. kermit://[user[:password]@]hostname[/path...]
  7795. Makes a connection to an [586]Internet Kermit Server.
  7796. http://[user[:password]@]hostname[/path...]
  7797. Makes a connection to Web server.
  7798. https://[user[:password]@]hostname[/path...]
  7799. Makes a connection to secure Web server.
  7800. [ [587]Top ] [ [588]Contents ] [ [589]C-Kermit Home ] [ [590]Kermit
  7801. Home ]
  7802. 17. LOGS
  7803. In C-Kermit 8.0, we make an effort to keep passwords out of the debug
  7804. log. This can never be 100% effective, but it's better than before,
  7805. when there were no precautions at all. Whenever Kermit knows it's
  7806. prompting for, parsing, or transmitting a password, it temporarily
  7807. turns off logging and then turns it back on afterwards. This keeps the
  7808. debug log password-free in most common cases, but there can be no
  7809. guarantees.
  7810. As noted elsewhere, the new "-dd" command-line option selects a
  7811. timestamped debug log (equivalent to "set debug timestamps on", "log
  7812. debug debug.log").
  7813. C-Kermit 8.0 also supports a new timestamped session log via "set
  7814. session-log timestamped-text", "log session".
  7815. There have been requests for other kinds of logs, for example a command
  7816. log. These might be added at some point. One person wanted to be able
  7817. to log commands with timestamps, but only commands issued at the
  7818. prompt, not commands from files or macros, and also wanted a header
  7819. line at the beginning showing the date, user, and host. This can be
  7820. done as follows:
  7821. .filename := \v(home)commands.log ; (for example)
  7822. fopen /write \%c \m(filename)
  7823. if success {
  7824. fwrite /line \%c \v(date): User=\v(user) Host=\v(host)
  7825. fclose \%c
  7826. set debug timestamps on
  7827. log debug {| grep "CMD(P)" >> \m(filename)} append
  7828. }
  7829. [ [591]Top ] [ [592]Contents ] [ [593]C-Kermit Home ] [ [594]Kermit
  7830. Home ]
  7831. __________________________________________________________________
  7832. C-Kermit 8.0 Update Notes / [595]The Kermit Project / Columbia
  7833. University / 15 Dec 2003 - 13 Sep 2010
  7834. References
  7835. 1. http://www.columbia.edu/
  7836. 2. mailto:kermit@columbia.edu
  7837. 3. http://www.columbia.edu/kermit/index.html
  7838. 4. http://www.columbia.edu/kermit/k95.html
  7839. 5. http://www.columbia.edu/kermit/ckermit.html
  7840. 6. http://www.columbia.edu/kermit/ckscripts.html
  7841. 7. http://www.columbia.edu/kermit/current.html
  7842. 8. http://www.columbia.edu/kermit/whatsnew.html
  7843. 9. http://www.columbia.edu/kermit/faq.html
  7844. 10. http://www.columbia.edu/kermit/support.html
  7845. 11. http://www.columbia.edu/kermit/ckermit80.html#contents
  7846. 12. http://www.columbia.edu/kermit/ckermit.html
  7847. 13. http://www.columbia.edu/kermit/index.html
  7848. 14. http://www.amazon.com/gp/product/1555581641?ie=UTF8&tag=aleidmoreldom-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1555581641
  7849. 15. http://www.columbia.edu/kermit/ckermit80.html
  7850. 16. mailto:kermit-support@columbia.edu
  7851. 17. http://www.columbia.edu/kermit/
  7852. 18. http://www.kermit-project.org/
  7853. 19. http://www.columbia.nyc.ny.us/kermit/
  7854. 20. ftp://kermit.columbia.edu/kermit/f/COPYING.TXT
  7855. 21. ftp://kermit.columbia.edu/kermit/f/ckcmai.c
  7856. 22. http://www.columbia.edu/kermit/ckermit80.html#xv
  7857. 23. http://www.columbia.edu/kermit/ck60manual.html
  7858. 24. http://www.columbia.edu/kermit/ckermi70.html
  7859. 25. ftp://kermit.columbia.edu/kermit/f/ckermit70.txt
  7860. 26. http://www.columbia.edu/kermit/ckututor.html
  7861. 27. ftp://kermit.columbia.edu/kermit/f/ckuker.nr
  7862. 28. http://www.columbia.edu/kermit/security.htm
  7863. 29. http://www.columbia.edu/kermit/telnet.htm
  7864. 30. http://www.columbia.edu/kermit/ftpscripts.html
  7865. 31. http://www.columbia.edu/kermit/ckcbwr.html
  7866. 32. ftp://kermit.columbia.edu/kermit/f/ckcbwr.txt
  7867. 33. http://www.columbia.edu/kermit/ckubwr.html
  7868. 34. ftp://kermit.columbia.edu/kermit/f/ckubwr.txt
  7869. 35. http://www.columbia.edu/kermit/ckvbwr.html
  7870. 36. ftp://kermit.columbia.edu/kermit/f/ckvbwr.txt
  7871. 37. http://www.columbia.edu/kermit/ckuins.html
  7872. 38. ftp://kermit.columbia.edu/kermit/f/ckuins.txt
  7873. 39. http://www.columbia.edu/kermit/ckvins.html
  7874. 40. ftp://kermit.columbia.edu/kermit/f/ckvins.txt
  7875. 41. http://www.columbia.edu/kermit/ckccfg.html
  7876. 42. ftp://kermit.columbia.edu/kermit/f/ckccfg.txt
  7877. 43. http://www.columbia.edu/kermit/ckcplm.html
  7878. 44. ftp://kermit.columbia.edu/kermit/f/ckcplm.txt
  7879. 45. http://www.columbia.edu/kermit/iksd.html
  7880. 46. http://www.columbia.edu/kermit/skermit.html
  7881. 47. http://www.columbia.edu/kermit/ckermit80.html#top
  7882. 48. http://www.columbia.edu/kermit/ckermit.html
  7883. 49. http://www.columbia.edu/kermit/index.html
  7884. 50. http://www.columbia.edu/kermit/ckermit80.html#x0
  7885. 51. http://www.columbia.edu/kermit/ckermit80.html#x1
  7886. 52. http://www.columbia.edu/kermit/ckermit80.html#x2
  7887. 53. http://www.columbia.edu/kermit/ckermit80.html#x2.1
  7888. 54. http://www.columbia.edu/kermit/ckermit80.html#x2.2
  7889. 55. http://www.columbia.edu/kermit/ckermit80.html#x2.2.1
  7890. 56. http://www.columbia.edu/kermit/ckermit80.html#x2.2.2
  7891. 57. http://www.columbia.edu/kermit/ckermit80.html#x2.2.3
  7892. 58. http://www.columbia.edu/kermit/ckermit80.html#x2.2.4
  7893. 59. http://www.columbia.edu/kermit/ckermit80.html#x2.2.5
  7894. 60. http://www.columbia.edu/kermit/ckermit80.html#x2.2.6
  7895. 61. http://www.columbia.edu/kermit/ckermit80.html#x3
  7896. 62. http://www.columbia.edu/kermit/ckermit80.html#x3.1
  7897. 63. http://www.columbia.edu/kermit/ckermit80.html#x3.1.1
  7898. 64. http://www.columbia.edu/kermit/ckermit80.html#x3.1.2
  7899. 65. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
  7900. 66. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
  7901. 67. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  7902. 68. http://www.columbia.edu/kermit/ckermit80.html#x3.3
  7903. 69. http://www.columbia.edu/kermit/ckermit80.html#x3.4
  7904. 70. http://www.columbia.edu/kermit/ckermit80.html#x3.5
  7905. 71. http://www.columbia.edu/kermit/ckermit80.html#x3.5.1
  7906. 72. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
  7907. 73. http://www.columbia.edu/kermit/ckermit80.html#x3.5.3
  7908. 74. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  7909. 75. http://www.columbia.edu/kermit/ckermit80.html#x3.6.1
  7910. 76. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
  7911. 77. http://www.columbia.edu/kermit/ckermit80.html#x3.6.3
  7912. 78. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  7913. 79. http://www.columbia.edu/kermit/ckermit80.html#x3.7.1
  7914. 80. http://www.columbia.edu/kermit/ckermit80.html#x3.7.2
  7915. 81. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  7916. 82. http://www.columbia.edu/kermit/ckermit80.html#x3.9
  7917. 83. http://www.columbia.edu/kermit/ckermit80.html#x3.10
  7918. 84. http://www.columbia.edu/kermit/ckermit80.html#x3.10.1
  7919. 85. http://www.columbia.edu/kermit/ckermit80.html#x3.10.2
  7920. 86. http://www.columbia.edu/kermit/ckermit80.html#x3.10.3
  7921. 87. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  7922. 88. http://www.columbia.edu/kermit/ckermit80.html#x4
  7923. 89. http://www.columbia.edu/kermit/ckermit80.html#x5
  7924. 90. http://www.columbia.edu/kermit/ckermit80.html#x6
  7925. 91. http://www.columbia.edu/kermit/ckermit80.html#x6.1
  7926. 92. http://www.columbia.edu/kermit/ckermit80.html#x6.2
  7927. 93. http://www.columbia.edu/kermit/ckermit80.html#x6.3
  7928. 94. http://www.columbia.edu/kermit/ckermit80.html#x6.4
  7929. 95. http://www.columbia.edu/kermit/ckermit80.html#x6.5
  7930. 96. http://www.columbia.edu/kermit/ckermit80.html#x6.6
  7931. 97. http://www.columbia.edu/kermit/ckermit80.html#x7
  7932. 98. http://www.columbia.edu/kermit/ckermit80.html#x8
  7933. 99. http://www.columbia.edu/kermit/ckermit80.html#x8.1
  7934. 100. http://www.columbia.edu/kermit/ckermit80.html#x8.2
  7935. 101. http://www.columbia.edu/kermit/ckermit80.html#x8.3
  7936. 102. http://www.columbia.edu/kermit/ckermit80.html#x8.4
  7937. 103. http://www.columbia.edu/kermit/ckermit80.html#x8.5
  7938. 104. http://www.columbia.edu/kermit/ckermit80.html#x8.6
  7939. 105. http://www.columbia.edu/kermit/ckermit80.html#x8.7
  7940. 106. http://www.columbia.edu/kermit/ckermit80.html#x8.8
  7941. 107. http://www.columbia.edu/kermit/ckermit80.html#x8.9
  7942. 108. http://www.columbia.edu/kermit/ckermit80.html#x8.10
  7943. 109. http://www.columbia.edu/kermit/ckermit80.html#x8.11
  7944. 110. http://www.columbia.edu/kermit/ckermit80.html#x8.12
  7945. 111. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  7946. 112. http://www.columbia.edu/kermit/ckermit80.html#x8.14
  7947. 113. http://www.columbia.edu/kermit/ckermit80.html#x9
  7948. 114. http://www.columbia.edu/kermit/ckermit80.html#x9.1
  7949. 115. http://www.columbia.edu/kermit/ckermit80.html#x9.2
  7950. 116. http://www.columbia.edu/kermit/ckermit80.html#x9.3
  7951. 117. http://www.columbia.edu/kermit/ckermit80.html#x9.4
  7952. 118. http://www.columbia.edu/kermit/ckermit80.html#x9.5
  7953. 119. http://www.columbia.edu/kermit/ckermit80.html#x9.6
  7954. 120. http://www.columbia.edu/kermit/ckermit80.html#x9.7
  7955. 121. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  7956. 122. http://www.columbia.edu/kermit/ckermit80.html#x9.9
  7957. 123. http://www.columbia.edu/kermit/ckermit80.html#x9.10
  7958. 124. http://www.columbia.edu/kermit/ckermit80.html#x9.11
  7959. 125. http://www.columbia.edu/kermit/ckermit80.html#x10
  7960. 126. http://www.columbia.edu/kermit/ckermit80.html#x11
  7961. 127. http://www.columbia.edu/kermit/ckermit80.html#x12
  7962. 128. http://www.columbia.edu/kermit/ckermit80.html#x13
  7963. 129. http://www.columbia.edu/kermit/ckermit80.html#x14
  7964. 130. http://www.columbia.edu/kermit/ckermit80.html#x15
  7965. 131. http://www.columbia.edu/kermit/ckermit80.html#x16
  7966. 132. http://www.columbia.edu/kermit/ckermit80.html#x17
  7967. 133. http://www.columbia.edu/kermit/ckermit80.html#top
  7968. 134. http://www.columbia.edu/kermit/ckermit.html
  7969. 135. http://www.columbia.edu/kermit/index.html
  7970. 136. http://www.columbia.edu/kermit/ckuins.html#x5
  7971. 137. http://www.columbia.edu/kermit/ckuins.html
  7972. 138. http://www.columbia.edu/kermit/ckermit80.html#x5
  7973. 139. http://www.columbia.edu/kermit/ckermit80.html#x2.2
  7974. 140. http://www.columbia.edu/kermit/ckermit80.html#contents
  7975. 141. http://www.columbia.edu/kermit/ckermit80.html#x15
  7976. 142. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  7977. 143. http://www.columbia.edu/kermit/ckermit80.html#ftpdates
  7978. 144. http://www.columbia.edu/kermit/ckermit80.html#ftpcheck
  7979. 145. http://www.columbia.edu/kermit/ckermit80.html#ftpnamelist
  7980. 146. http://www.columbia.edu/kermit/ckermit80.html#srvrename
  7981. 147. http://www.columbia.edu/kermit/ckermit80.html#ftpvdir
  7982. 148. http://www.columbia.edu/kermit/ckermit80.html#setftptype
  7983. 149. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  7984. 150. http://www.columbia.edu/kermit/ckermit80.html#x15
  7985. 151. http://www.columbia.edu/kermit/ckermit80.html#x8.7
  7986. 152. http://www.columbia.edu/kermit/ckermit80.html#x2.1
  7987. 153. http://www.columbia.edu/kermit/ckermit80.html#x2.2
  7988. 154. http://www.columbia.edu/kermit/ckermit80.html#x8.14
  7989. 155. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  7990. 156. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  7991. 157. http://www.columbia.edu/kermit/ckututor.html
  7992. 158. http://www.columbia.edu/kermit/ckuins.html
  7993. 159. http://www.columbia.edu/kermit/skermit.html
  7994. 160. http://www.columbia.edu/kermit/ckermit80.html#setlocus
  7995. 161. http://www.columbia.edu/kermit/ckermit80.html#lcommands
  7996. 162. http://www.columbia.edu/kermit/ckermit80.html#ftpuser
  7997. 163. http://www.columbia.edu/kermit/ckermit80.html#showvar
  7998. 164. http://www.columbia.edu/kermit/ckermit80.html#callerid
  7999. 165. http://www.columbia.edu/kermit/ckermit80.html#x6.6
  8000. 166. http://www.columbia.edu/kermit/ckermit80.html#x0
  8001. 167. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8002. 168. http://www.columbia.edu/kermit/ckermit80.html#top
  8003. 169. http://www.columbia.edu/kermit/ckermit80.html#contents
  8004. 170. http://www.columbia.edu/kermit/ckermit.html
  8005. 171. http://www.columbia.edu/kermit/index.html
  8006. 172. http://www.columbia.edu/kermit/ckermit80.html#x0
  8007. 173. http://www.columbia.edu/kermit/ckermit80.html#top
  8008. 174. http://www.columbia.edu/kermit/ckermit80.html#contents
  8009. 175. http://www.columbia.edu/kermit/ckermit.html
  8010. 176. http://www.columbia.edu/kermit/index.html
  8011. 177. http://www.columbia.edu/kermit/k95.html
  8012. 178. http://www.columbia.edu/kermit/sshclient.html
  8013. 179. http://www.columbia.edu/kermit/skermit.html
  8014. 180. http://www.columbia.edu/kermit/skermit.html
  8015. 181. http://www.columbia.edu/kermit/sshclien.htm
  8016. 182. http://www.columbia.edu/kermit/ckermit80.html#x3
  8017. 183. ftp://ftp.isi.edu/in-notes/rfc1738.txt
  8018. 184. http://www.columbia.edu/kermit/ckermit80.html#x2.2.2
  8019. 185. http://www.columbia.edu/kermit/ckermit80.html#x2.2.1
  8020. 186. ftp://ftp.isi.edu/in-notes/rfc2396.txt
  8021. 187. ftp://ftp.isi.edu/in-notes/rfc2616.txt
  8022. 188. http://www.columbia.edu/kermit/ckermit80.html#x2.2.3
  8023. 189. ftp://ftp.isi.edu/in-notes/rfc2616.txt
  8024. 190. http://www.columbia.edu/kermit/ckermit80.html#x8.13.7
  8025. 191. http://www.columbia.edu/kermit/security.htm#x5.4
  8026. 192. http://www.columbia.edu/kermit/security.htm#x15
  8027. 193. http://www.columbia.edu/kermit/security.htm#x6.2
  8028. 194. http://www.columbia.edu/kermit/security.html
  8029. 195. http://www.columbia.edu/kermit/ckermit80.html#x16
  8030. 196. http://www.columbia.edu/kermit/ckermit80.html#top
  8031. 197. http://www.columbia.edu/kermit/ckermit80.html#contents
  8032. 198. http://www.columbia.edu/kermit/ckermit.html
  8033. 199. http://www.columbia.edu/kermit/index.html
  8034. 200. http://www.columbia.edu/kermit/ckermit80.html#x3.1
  8035. 201. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8036. 202. http://www.columbia.edu/kermit/ckermit80.html#x3.3
  8037. 203. http://www.columbia.edu/kermit/ckermit80.html#x3.4
  8038. 204. http://www.columbia.edu/kermit/ckermit80.html#x3.5
  8039. 205. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  8040. 206. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8041. 207. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8042. 208. http://www.columbia.edu/kermit/ckermit80.html#x3.9
  8043. 209. http://www.columbia.edu/kermit/ckermit80.html#x3.10
  8044. 210. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8045. 211. http://www.columbia.edu/kermit/security.htm
  8046. 212. http://www.columbia.edu/kermit/security.htm#servers
  8047. 213. http://www.columbia.edu/kermit/ckcsets.html
  8048. 214. http://www.columbia.edu/kermit/unicode.html
  8049. 215. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
  8050. 216. http://www.columbia.edu/kermit/case10.html
  8051. 217. http://www.columbia.edu/kermit/ckermit80.html#x4
  8052. 218. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8053. 219. http://www.columbia.edu/kermit/ftpscripts.html
  8054. 220. http://www.columbia.edu/kermit/ckermit80.html#top
  8055. 221. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8056. 222. http://www.columbia.edu/kermit/ftpclient.html
  8057. 223. http://www.columbia.edu/kermit/ftpscripts.html
  8058. 224. http://www.columbia.edu/kermit/ckermit.html
  8059. 225. http://www.columbia.edu/kermit/index.html
  8060. 226. http://www.columbia.edu/kermit/ckermit80.html#x3.1.1
  8061. 227. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
  8062. 228. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
  8063. 229. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
  8064. 230. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
  8065. 231. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8066. 232. http://www.columbia.edu/kermit/ckermit80.html#x3.5
  8067. 233. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  8068. 234. http://www.columbia.edu/kermit/ftpscripts.html
  8069. 235. http://www.columbia.edu/kermit/ckb2.htm
  8070. 236. http://www.columbia.edu/kermit/ckermit80.html#ftpautolog
  8071. 237. http://www.columbia.edu/kermit/ckermit80.html#ftpuser
  8072. 238. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8073. 239. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8074. 240. http://www.columbia.edu/kermit/ckermit80.html#top
  8075. 241. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8076. 242. http://www.columbia.edu/kermit/ckermit.html
  8077. 243. http://www.columbia.edu/kermit/index.html
  8078. 244. http://www.columbia.edu/kermit/ibm_ie.html
  8079. 245. http://www.columbia.edu/kermit/ckermit80.html#x3.10
  8080. 246. http://www.columbia.edu/kermit/ckermit80.html#top
  8081. 247. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8082. 248. http://www.columbia.edu/kermit/ckermit.html
  8083. 249. http://www.columbia.edu/kermit/index.html
  8084. 250. http://www.columbia.edu/kermit/ck60manual.html
  8085. 251. http://www.columbia.edu/kermit/ckermit70.html#x4.17
  8086. 252. http://www.columbia.edu/kermit/ckermit70.html
  8087. 253. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  8088. 254. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8089. 255. http://www.columbia.edu/kermit/ckermit80.html#x3.1.4
  8090. 256. http://www.columbia.edu/kermit/security.html
  8091. 257. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8092. 258. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8093. 259. http://www.columbia.edu/kermit/ckermit80.html#x8.13.4
  8094. 260. http://www.columbia.edu/kermit/ckermit80.html#permswitch
  8095. 261. http://www.columbia.edu/kermit/ckermit80.html#ftpchmod
  8096. 262. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
  8097. 263. http://www.columbia.edu/kermit/ckermit80.html#x4
  8098. 264. http://www.columbia.edu/kermit/ckermit80.html#top
  8099. 265. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8100. 266. http://www.columbia.edu/kermit/ckermit.html
  8101. 267. http://www.columbia.edu/kermit/index.html
  8102. 268. http://www.columbia.edu/kermit/ckermit80.html#x7
  8103. 269. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8104. 270. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8105. 271. http://www.columbia.edu/kermit/ckb2.htm
  8106. 272. http://www.columbia.edu/kermit/ckermit80.html#x3.10
  8107. 273. http://www.columbia.edu/kermit/ckermit80.html#x3.10
  8108. 274. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  8109. 275. http://www.columbia.edu/kermit/ckermit80.html#setftptype
  8110. 276. http://www.columbia.edu/kermit/ckermit80.html#top
  8111. 277. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8112. 278. http://www.columbia.edu/kermit/ckermit.html
  8113. 279. http://www.columbia.edu/kermit/index.html
  8114. 280. http://www.columbia.edu/kermit/ckermit70.html#x4.9
  8115. 281. http://www.columbia.edu/kermit/ckermit80.html#x3.5.1
  8116. 282. http://www.columbia.edu/kermit/ckermit80.html#erroraction
  8117. 283. http://www.columbia.edu/kermit/ckermit70.html#x1.5
  8118. 284. http://www.columbia.edu/kermit/ckermit70.html#x4.7
  8119. 285. http://www.columbia.edu/kermit/ckermit70.html#x1.6
  8120. 286. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  8121. 287. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
  8122. 288. http://www.columbia.edu/kermit/ckermi70.htm
  8123. 289. http://www.columbia.edu/kermit/ckermit80.html#x4
  8124. 290. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8125. 291. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
  8126. 292. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8127. 293. http://www.columbia.edu/kermit/ckermit80.html#erroraction
  8128. 294. http://www.columbia.edu/kermit/ckermit80.html#x3.5.2
  8129. 295. http://www.columbia.edu/kermit/ckermit80.html#erroraction
  8130. 296. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
  8131. 297. http://www.columbia.edu/kermit/ckermit80.html#ftpperms
  8132. 298. http://www.columbia.edu/kermit/ckermit80.html#ftpunique
  8133. 299. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
  8134. 300. http://www.columbia.edu/kermit/ckermit80.html#note_utc
  8135. 301. http://www.columbia.edu/kermit/ckermit80.html#note_date
  8136. 302. http://www.columbia.edu/kermit/ckermit80.html#x3.6
  8137. 303. http://www.boulder.nist.gov/timefreq/faq/faq.htm#10:
  8138. 304. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8139. 305. http://www.columbia.edu/kermit/ckermit80.html#top
  8140. 306. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8141. 307. http://www.columbia.edu/kermit/ckermit.html
  8142. 308. http://www.columbia.edu/kermit/index.html
  8143. 309. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8144. 310. http://www.columbia.edu/kermit/ckermi70.htm#x4.3
  8145. 311. http://www.columbia.edu/kermit/ckermit70.html
  8146. 312. http://www.columbia.edu/kermit/ckermit80.html#x5
  8147. 313. http://www.columbia.edu/kermit/ckermit80.html#x3.6.3
  8148. 314. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
  8149. 315. http://www.columbia.edu/kermit/ckermi70.htm#x4.1
  8150. 316. http://www.columbia.edu/kermit/ckermi70.htm#x4.2.2
  8151. 317. http://www.columbia.edu/kermit/ckermi70.htm#x1.5.4
  8152. 318. http://www.columbia.edu/kermit/ckermit80.html#x3.6.2
  8153. 319. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8154. 320. http://www.columbia.edu/kermit/ckermit80.html#x3.11
  8155. 321. http://www.columbia.edu/kermit/ckermit80.html#srvrename
  8156. 322. http://www.columbia.edu/kermit/ckermi70.htm#x4.1
  8157. 323. http://www.columbia.edu/kermit/ckermi70.htm
  8158. 324. http://www.columbia.edu/kermit/ckb2.htm
  8159. 325. http://www.columbia.edu/kermit/ckermit80.html#ftpfilenames
  8160. 326. http://www.columbia.edu/kermit/ckermit80.html#x3.5.3
  8161. 327. http://www.proftpd.net/
  8162. 328. http://www.columbia.edu/kermit/ckermit80.html#top
  8163. 329. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8164. 330. http://www.columbia.edu/kermit/ckermit.html
  8165. 331. http://www.columbia.edu/kermit/index.html
  8166. 332. http://www.columbia.edu/kermit/ckb2.htm
  8167. 333. http://www.columbia.edu/kermit/ckcsets.html
  8168. 334. http://www.columbia.edu/kermit/unicode.html
  8169. 335. http://www.columbia.edu/kermit/ckcsets.html
  8170. 336. http://www.columbia.edu/kermit/ckcsets.html
  8171. 337. http://www.columbia.edu/kermit/ckermit80.html#x4
  8172. 338. http://www.columbia.edu/kermit/utf8.html
  8173. 339. http://www.columbia.edu/kermit/ckcsets.html
  8174. 340. http://www.columbia.edu/kermit/ckermit80.html#x4
  8175. 341. ftp://ftp.isi.edu/in-notes/rfc2640.txt
  8176. 342. http://www.columbia.edu/kermit/ckermit80.html#top
  8177. 343. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8178. 344. http://www.columbia.edu/kermit/ckermit.html
  8179. 345. http://www.columbia.edu/kermit/index.html
  8180. 346. http://www.columbia.edu/kermit/ckermit80.html#top
  8181. 347. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8182. 348. http://www.columbia.edu/kermit/ckermit.html
  8183. 349. http://www.columbia.edu/kermit/index.html
  8184. 350. http://www.columbia.edu/kermit/ckermit80.html#top
  8185. 351. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8186. 352. http://www.columbia.edu/kermit/ckermit.html
  8187. 353. http://www.columbia.edu/kermit/index.html
  8188. 354. http://www.columbia.edu/kermit/ftpscripts.html
  8189. 355. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8190. 356. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8191. 357. ftp://ftp.isi.edu/in-notes/rfc959.txt
  8192. 358. http://www.columbia.edu/kermit/ckscripts.html
  8193. 359. http://www.columbia.edu/kermit/ckermit80.html#top
  8194. 360. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8195. 361. http://www.columbia.edu/kermit/ftpscript.html
  8196. 362. http://www.columbia.edu/kermit/ckermit.html
  8197. 363. http://www.columbia.edu/kermit/index.html
  8198. 364. http://www.columbia.edu/kermit/ckermit80.html#x3.11.1
  8199. 365. http://www.columbia.edu/kermit/ckermit80.html#x3.11.2
  8200. 366. http://www.columbia.edu/kermit/ckermit80.html#x3.11.3
  8201. 367. http://www.columbia.edu/kermit/ckermit80.html#x3.11.4
  8202. 368. http://www.columbia.edu/kermit/ckermit80.html#x3.11.5
  8203. 369. http://www.columbia.edu/kermit/ckermit.html
  8204. 370. http://www.columbia.edu/kermit/k95.html
  8205. 371. http://www.columbia.edu/kermit/ckermit80.html#x3.11.5
  8206. 372. ftp://ftp.isi.edu/in-notes/rfc959.txt
  8207. 373. ftp://ftp.isi.edu/in-notes/rfc2389.txt
  8208. 374. http://www.ietf.org/internet-drafts/draft-ietf-ftpext-mlst-16.txt
  8209. 375. http://www.columbia.edu/kermit/ftpclient.html
  8210. 376. http://www.columbia.edu/kermit/ckermit80.html#top
  8211. 377. http://www.columbia.edu/kermit/ckermit80.html#ftp
  8212. 378. http://www.columbia.edu/kermit/ckermit.html
  8213. 379. http://www.columbia.edu/kermit/index.html
  8214. 380. http://www.columbia.edu/kermit/ckermit80.html#x3
  8215. 381. http://www.columbia.edu/kermit/ckermit80.html#ucs2
  8216. 382. http://www.columbia.edu/kermit/ckermit80.html#top
  8217. 383. http://www.columbia.edu/kermit/ckermit80.html#contents
  8218. 384. http://www.columbia.edu/kermit/ckermit.html
  8219. 385. http://www.columbia.edu/kermit/index.html
  8220. 386. http://www.columbia.edu/kermit/ckermit80.html#top
  8221. 387. http://www.columbia.edu/kermit/ckermit80.html#contents
  8222. 388. http://www.columbia.edu/kermit/ckermit.html
  8223. 389. http://www.columbia.edu/kermit/index.html
  8224. 390. http://www.columbia.edu/kermit/ckb2.htm
  8225. 391. http://www.columbia.edu/kermit/ckermit80.html#top
  8226. 392. http://www.columbia.edu/kermit/ckermit80.html#contents
  8227. 393. http://www.columbia.edu/kermit/ckermit.html
  8228. 394. http://www.columbia.edu/kermit/index.html
  8229. 395. http://www.columbia.edu/kermit/ckermit80.html#x4
  8230. 396. http://www.columbia.edu/kermit/ckermit80.html#x4
  8231. 397. http://www.columbia.edu/kermit/ckermit80.html#x8.12
  8232. 398. http://www.columbia.edu/kermit/ckermit80.html#x8.1
  8233. 399. http://www.columbia.edu/kermit/ckermit80.html#x12
  8234. 400. http://www.columbia.edu/kermit/ckermit80.html#x8.12
  8235. 401. http://www.columbia.edu/kermit/ckermit80.html#top
  8236. 402. http://www.columbia.edu/kermit/ckermit80.html#contents
  8237. 403. http://www.columbia.edu/kermit/ckermit.html
  8238. 404. http://www.columbia.edu/kermit/index.html
  8239. 405. http://www.columbia.edu/kermit/ckermit80.html#x8.14
  8240. 406. http://www.columbia.edu/kermit/ckermit80.html#top
  8241. 407. http://www.columbia.edu/kermit/ckermit80.html#contents
  8242. 408. http://www.columbia.edu/kermit/ckermit.html
  8243. 409. http://www.columbia.edu/kermit/index.html
  8244. 410. http://www.columbia.edu/kermit/ckermit80.html#x9
  8245. 411. http://www.columbia.edu/kermit/ckermit80.html#top
  8246. 412. http://www.columbia.edu/kermit/ckermit80.html#contents
  8247. 413. http://www.columbia.edu/kermit/ckermit.html
  8248. 414. http://www.columbia.edu/kermit/index.html
  8249. 415. http://www.columbia.edu/kermit/ckermit80.html#x8.6
  8250. 416. http://www.columbia.edu/kermit/ckermit80.html#top
  8251. 417. http://www.columbia.edu/kermit/ckermit80.html#contents
  8252. 418. http://www.columbia.edu/kermit/ckermit.html
  8253. 419. http://www.columbia.edu/kermit/index.html
  8254. 420. http://www.columbia.edu/kermit/ckermit80.html#top
  8255. 421. http://www.columbia.edu/kermit/ckermit80.html#contents
  8256. 422. http://www.columbia.edu/kermit/ckermit.html
  8257. 423. http://www.columbia.edu/kermit/index.html
  8258. 424. http://www.columbia.edu/kermit/ckermit80.html#top
  8259. 425. http://www.columbia.edu/kermit/ckermit80.html#contents
  8260. 426. http://www.columbia.edu/kermit/ckermit.html
  8261. 427. http://www.columbia.edu/kermit/index.html
  8262. 428. http://www.columbia.edu/kermit/ckermit80.html#fjoin
  8263. 429. http://www.columbia.edu/kermit/ckermit80.html#fsplit
  8264. 430. http://www.columbia.edu/kermit/ckermit80.html#x8.10
  8265. 431. http://www.columbia.edu/kermit/ckermit80.html#top
  8266. 432. http://www.columbia.edu/kermit/ckermit80.html#contents
  8267. 433. http://www.columbia.edu/kermit/ckermit.html
  8268. 434. http://www.columbia.edu/kermit/index.html
  8269. 435. http://www.columbia.edu/kermit/ckermit80.html#x9
  8270. 436. http://www.columbia.edu/kermit/ckermit80.html#x9
  8271. 437. http://www.columbia.edu/kermit/ckermit80.html#x9
  8272. 438. http://www.columbia.edu/kermit/ckermit80.html#x3
  8273. 439. http://www.columbia.edu/kermit/ckermit80.html#x3
  8274. 440. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8275. 441. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8276. 442. http://www.columbia.edu/kermit/ckermit80.html#x3.8
  8277. 443. http://www.columbia.edu/kermit/ckermit80.html#x3
  8278. 444. http://www.columbia.edu/kermit/ckermit80.html#x3
  8279. 445. http://www.columbia.edu/kermit/ckermit80.html#x3
  8280. 446. http://www.columbia.edu/kermit/ckermit80.html#x3.2
  8281. 447. http://www.columbia.edu/kermit/ckermit80.html#x3
  8282. 448. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  8283. 449. http://www.columbia.edu/kermit/ckermit80.html#x8.13
  8284. 450. http://www.columbia.edu/kermit/ckermit80.html#x9
  8285. 451. http://www.columbia.edu/kermit/ckermit80.html#x8.10
  8286. 452. http://www.columbia.edu/kermit/ckermit80.html#x8.7.4
  8287. 453. http://www.columbia.edu/kermit/ckermit80.html#top
  8288. 454. http://www.columbia.edu/kermit/ckermit80.html#contents
  8289. 455. http://www.columbia.edu/kermit/ckermit.html
  8290. 456. http://www.columbia.edu/kermit/index.html
  8291. 457. http://www.columbia.edu/kermit/ckermit80.html#top
  8292. 458. http://www.columbia.edu/kermit/ckermit80.html#contents
  8293. 459. http://www.columbia.edu/kermit/ckermit.html
  8294. 460. http://www.columbia.edu/kermit/index.html
  8295. 461. http://www.columbia.edu/kermit/ckermit80.html#top
  8296. 462. http://www.columbia.edu/kermit/ckermit80.html#contents
  8297. 463. http://www.columbia.edu/kermit/ckermit.html
  8298. 464. http://www.columbia.edu/kermit/index.html
  8299. 465. http://www.columbia.edu/kermit/ckermit80.html#x8.7
  8300. 466. http://www.columbia.edu/kermit/ckermit80.html#top
  8301. 467. http://www.columbia.edu/kermit/ckermit80.html#contents
  8302. 468. http://www.columbia.edu/kermit/ckermit.html
  8303. 469. http://www.columbia.edu/kermit/index.html
  8304. 470. http://www.columbia.edu/kermit/ckermit80.html#scriptedit
  8305. 471. http://www.columbia.edu/kermit/ckermit80.html#top
  8306. 472. http://www.columbia.edu/kermit/ckermit80.html#contents
  8307. 473. http://www.columbia.edu/kermit/ckermit.html
  8308. 474. http://www.columbia.edu/kermit/index.html
  8309. 475. http://www.columbia.edu/kermit/ckermit80.html#top
  8310. 476. http://www.columbia.edu/kermit/ckermit80.html#contents
  8311. 477. http://www.columbia.edu/kermit/ckermit.html
  8312. 478. http://www.columbia.edu/kermit/index.html
  8313. 479. ftp://ftp.isi.edu/in-notes/rfc2822.txt
  8314. 480. ftp://ftp.isi.edu/in-notes/rfc2822.txt
  8315. 481. ftp://ftp.isi.edu/in-notes/rfc2822.txt
  8316. 482. ftp://ftp.isi.edu/in-notes/rfc2822.txt
  8317. 483. http://www.columbia.edu/kermit/ckermit80.html#top
  8318. 484. http://www.columbia.edu/kermit/ckermit80.html#contents
  8319. 485. http://www.columbia.edu/kermit/ckermit.html
  8320. 486. http://www.columbia.edu/kermit/index.html
  8321. 487. http://www.columbia.edu/kermit/ckermit80.html#x8.1
  8322. 488. http://www.columbia.edu/kermit/ckermit80.html#top
  8323. 489. http://www.columbia.edu/kermit/ckermit80.html#contents
  8324. 490. http://www.columbia.edu/kermit/ckermit.html
  8325. 491. http://www.columbia.edu/kermit/index.html
  8326. 492. http://www.columbia.edu/kermit/ckermit80.html#x8.2
  8327. 493. http://www.columbia.edu/kermit/ckermit80.html#top
  8328. 494. http://www.columbia.edu/kermit/ckermit80.html#contents
  8329. 495. http://www.columbia.edu/kermit/ckermit.html
  8330. 496. http://www.columbia.edu/kermit/index.html
  8331. 497. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8332. 498. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8333. 499. http://www.columbia.edu/kermit/ckermit80.html#x8.2
  8334. 500. http://www.columbia.edu/kermit/ckermit80.html#top
  8335. 501. http://www.columbia.edu/kermit/ckermit80.html#contents
  8336. 502. http://www.columbia.edu/kermit/ckermit.html
  8337. 503. http://www.columbia.edu/kermit/index.html
  8338. 504. http://www.columbia.edu/kermit/ckermit80.html#top
  8339. 505. http://www.columbia.edu/kermit/ckermit80.html#contents
  8340. 506. http://www.columbia.edu/kermit/ckermit.html
  8341. 507. http://www.columbia.edu/kermit/index.html
  8342. 508. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8343. 509. http://www.columbia.edu/kermit/ckermit80.html#top
  8344. 510. http://www.columbia.edu/kermit/ckermit80.html#contents
  8345. 511. http://www.columbia.edu/kermit/ckermit.html
  8346. 512. http://www.columbia.edu/kermit/index.html
  8347. 513. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8348. 514. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8349. 515. http://www.columbia.edu/kermit/ckermit80.html#x9.6
  8350. 516. http://www.columbia.edu/kermit/ckermit80.html#top
  8351. 517. http://www.columbia.edu/kermit/ckermit80.html#contents
  8352. 518. http://www.columbia.edu/kermit/ckermit.html
  8353. 519. http://www.columbia.edu/kermit/index.html
  8354. 520. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8355. 521. http://www.columbia.edu/kermit/ckermit80.html#x9.8
  8356. 522. http://www.columbia.edu/kermit/ckermit80.html#top
  8357. 523. http://www.columbia.edu/kermit/ckermit80.html#contents
  8358. 524. http://www.columbia.edu/kermit/ckermit.html
  8359. 525. http://www.columbia.edu/kermit/index.html
  8360. 526. http://www.columbia.edu/kermit/ckermit80.html#top
  8361. 527. http://www.columbia.edu/kermit/ckermit80.html#contents
  8362. 528. http://www.columbia.edu/kermit/ckermit.html
  8363. 529. http://www.columbia.edu/kermit/index.html
  8364. 530. http://www.columbia.edu/kermit/ckermit80.html#top
  8365. 531. http://www.columbia.edu/kermit/ckermit80.html#contents
  8366. 532. http://www.columbia.edu/kermit/ckermit.html
  8367. 533. http://www.columbia.edu/kermit/index.html
  8368. 534. mailto:thucdat@hotmail.com
  8369. 535. http://www.columbia.edu/kermit/ckermit80.html#x9.9.2
  8370. 536. http://www.columbia.edu/kermit/ckermit80.html#top
  8371. 537. http://www.columbia.edu/kermit/ckermit80.html#contents
  8372. 538. http://www.columbia.edu/kermit/ckermit.html
  8373. 539. http://www.columbia.edu/kermit/index.html
  8374. 540. http://www.columbia.edu/kermit/ckermit80.html#top
  8375. 541. http://www.columbia.edu/kermit/ckermit80.html#contents
  8376. 542. http://www.columbia.edu/kermit/ckermit.html
  8377. 543. http://www.columbia.edu/kermit/index.html
  8378. 544. http://www.columbia.edu/kermit/ckermit80.html#top
  8379. 545. http://www.columbia.edu/kermit/ckermit80.html#contents
  8380. 546. http://www.columbia.edu/kermit/ckermit.html
  8381. 547. http://www.columbia.edu/kermit/index.html
  8382. 548. http://www.columbia.edu/kermit/ckermit80.html#x9.2
  8383. 549. http://www.columbia.edu/kermit/ckermit80.html#top
  8384. 550. http://www.columbia.edu/kermit/ckermit80.html#contents
  8385. 551. http://www.columbia.edu/kermit/ckermit.html
  8386. 552. http://www.columbia.edu/kermit/index.html
  8387. 553. http://www.columbia.edu/kermit/ckermit80.html#x4
  8388. 554. http://www.columbia.edu/kermit/ckermit80.html#x4
  8389. 555. http://www.columbia.edu/kermit/ckermit80.html#top
  8390. 556. http://www.columbia.edu/kermit/ckermit80.html#contents
  8391. 557. http://www.columbia.edu/kermit/ckermit.html
  8392. 558. http://www.columbia.edu/kermit/index.html
  8393. 559. http://www.columbia.edu/kermit/ckermit80.html#top
  8394. 560. http://www.columbia.edu/kermit/ckermit80.html#contents
  8395. 561. http://www.columbia.edu/kermit/ckermit.html
  8396. 562. http://www.columbia.edu/kermit/index.html
  8397. 563. http://www.columbia.edu/kermit/ckermit80.html#top
  8398. 564. http://www.columbia.edu/kermit/ckermit80.html#contents
  8399. 565. http://www.columbia.edu/kermit/ckermit.html
  8400. 566. http://www.columbia.edu/kermit/index.html
  8401. 567. http://www.columbia.edu/kermit/ckermit80.html#x4
  8402. 568. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8403. 569. http://www.columbia.edu/kermit/ckermit80.html#x3.7
  8404. 570. http://www.columbia.edu/kermit/ckermit80.html#top
  8405. 571. http://www.columbia.edu/kermit/ckermit80.html#contents
  8406. 572. http://www.columbia.edu/kermit/ckermit.html
  8407. 573. http://www.columbia.edu/kermit/index.html
  8408. 574. ftp://ftp.isi.edu/in-notes/rfc2217.txt
  8409. 575. http://www.columbia.edu/kermit/ckermit80.html#top
  8410. 576. http://www.columbia.edu/kermit/ckermit80.html#contents
  8411. 577. ftp://kermit.columbia.edu/kermit/sredird/
  8412. 578. http://www.columbia.edu/kermit/ckermit.html
  8413. 579. http://www.columbia.edu/kermit/index.html
  8414. 580. http://www.columbia.edu/kermit/ckermi70.htm#x4.22
  8415. 581. http://www.columbia.edu/kermit/ckermit80.html#top
  8416. 582. http://www.columbia.edu/kermit/ckermit80.html#contents
  8417. 583. http://www.columbia.edu/kermit/ckermit.html
  8418. 584. http://www.columbia.edu/kermit/index.html
  8419. 585. http://www.columbia.edu/kermit/ckermit80.html#x3.1.3
  8420. 586. http://www.columbia.edu/kermit/cuiksd.html
  8421. 587. http://www.columbia.edu/kermit/ckermit80.html#top
  8422. 588. http://www.columbia.edu/kermit/ckermit80.html#contents
  8423. 589. http://www.columbia.edu/kermit/ckermit.html
  8424. 590. http://www.columbia.edu/kermit/index.html
  8425. 591. http://www.columbia.edu/kermit/ckermit80.html#top
  8426. 592. http://www.columbia.edu/kermit/ckermit80.html#contents
  8427. 593. http://www.columbia.edu/kermit/ckermit.html
  8428. 594. http://www.columbia.edu/kermit/index.html
  8429. 595. http://www.columbia.edu/kermit/index.html