|
Posted by gustav on 10/14/05 09:57
Hi there!
I have a string like this... (envorinment string)
HOSTfriggAUDIODEV/tmp/SUNWut/dev/utaudio/8dtstart_sessionlogfile/dev/nullDTSCREENSAVERLISTStartDtscreenBlankXMBINDDIR/usr/dt/lib/bindingsUTAUDIODEV/tmp/SUNWut/dev/utaudio/8AB_CARDCATALOG/usr/dt/share/answerbooks/C/ab_cardcatalogLC_ALLCDTLOGINDISPLAYCLASSSunRayOSTYPEsolarisPWD/home/student/2003/a03guswi/ht05USERa03guswiSESSION_SVRfriggLANGCLOGNAMEa03guswiGROUPstudentGNOME_DESKTOP_SESSION_IDDefaultG_BROKEN_FILENAMESyesSHLVL2XMICONBMSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%BPATH/usr/local/bin/system:/usr/bin:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWut/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/local/bin:/openpkg/bin:/usr/dt/bin:.WINDOWID9437227DTXSERVERLOCATIONlocalCOLORTERMgnome-terminalHELPPATH/usr/openwin/lib/locale:/usr/openwin/lib/helpHOSTTYPEsun4DTDEVROOT/tmp/SUNWut/sessions/34TERMxtermHOME/home/student/2003/a03guswiCORONA_TOKENpseudo.080020b9346fXFILESEARCHPATH/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%SMANPATH/usr/man:/usr/openwin/man:/usr/dt/man:/usr/local/man:/opt/SUNWspro/man:/openpkg/man:/opt/SUNWut/man:/usr/sfw/man:/opt/sfw/manDISPLAYfrigg:34DTHELPSEARCHPATH/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.sdl:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.hv:/home/student/2003/a03guswi/.dt/help/%H:/home/student/2003/a03guswi/.dt/help/%H.sdl:/home/student/2003/a03guswi/.dt/help/%H.hv:/usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hvGTK_RC_FILES/etc/gtk/gtkrc:/home/student/2003/a03guswi/.gtkrc-1.2-gnome2EDITOR/usr/dt/bin/dtpadMAIL/var/mail/a03guswiTZMETSDT_NO_DTDBCACHE1DTDATABASESEARCHPATH/home/student/2003/a03guswi/.dt/types,/etc/dt/appconfig/types/%L,/etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/CVENDORsunXMICONSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%BLC_CTYPECGNOME_KEYRING_SOCKET/var/tmp/keyring-6VSyxE/socketUTDEVROOT/tmp/SUNWut/sessions/34/unitSTART_SPECKEYSDnoSESSIONTYPEaltDtDTAPPSEARCHPATH/home/student/2003/a03guswi/.dt/appmanager:/etc/dt/appconfig/appmanager/%L:/etc/dt/appconfig/appmanager/C:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/CDTUSERSESSIONa03guswi-frigg-34OPENWINHOME/usr/openwin_/usr/bin/gnome-sessionDESKTOP_STARTUP_IDSDT_NO_TOOLTALK1MACHTYPEsparcSHELL/bin/tcshSESSION_MANAGERlocal/frigg:/tmp/.ICE-unix/22161,inet6/frigg:38974,inet/frigg:38975G_FILENAME_ENCODING@locale,UTF-8SUN_SUNRAY_TOKENpseudo.080020b9346f
I want to divide it into something like
HOST=frigg
AUDIODEV=HOSTfriggAUDIODEV/tmp/SUNWut/dev/utaudio/8dtstart_sessionlogfile/dev/null
DTSCREENSAVERLISTS=tartDtscreenBlank
XMBINDDIR=/usr/dt/lib/bindings
UTAUDIODEV=/tmp/SUNWut/dev/utaudio/
8AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
LC_ALLCDTLOGINDISPLAYCLASS=SunRay
OSTYPEsolarisPWD/home/student/2003/a03guswi/ht05USERa03guswiSESSION_SVRfriggLANGCLOGNAMEa03guswiGROUPstudentGNOME_DESKTOP_SESSION_IDDefaultG_BROKEN_FILENAMESyesSHLVL2XMICONBMSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%BPATH/usr/local/bin/system:/usr/bin:/usr/openwin/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/opt/SUNWut/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/local/bin:/openpkg/bin:/usr/dt/bin:.WINDOWID9437227DTXSERVERLOCATIONlocalCOLORTERMgnome-terminalHELPPATH/usr/openwin/lib/locale:/usr/openwin/lib/helpHOSTTYPEsun4DTDEVROOT/tmp/SUNWut/sessions/34TERMxtermHOME/home/student/2003/a03guswiCORONA_TOKENpseudo.080020b9346fXFILESEARCHPATH/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%SMANPATH/usr/man:/usr/openwin/man:/usr/dt/man:/usr/local/man:/opt/SUNWspro/man:/openpkg/man:/opt/SUNWut/man:/usr/sfw/man:/opt/sfw/manDISPLAYfrigg:34DTHELPSEARCHPATH/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.sdl:/home/student/2003/a03guswi/.dt/help/a03guswi-frigg-34/%H.hv:/home/student/2003/a03guswi/.dt/help/%H:/home/student/2003/a03guswi/.dt/help/%H.sdl:/home/student/2003/a03guswi/.dt/help/%H.hv:/usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hvGTK_RC_FILES/etc/gtk/gtkrc:/home/student/2003/a03guswi/.gtkrc-1.2-gnome2EDITOR/usr/dt/bin/dtpadMAIL/var/mail/a03guswiTZMETSDT_NO_DTDBCACHE1DTDATABASESEARCHPATH/home/student/2003/a03guswi/.dt/types,/etc/dt/appconfig/types/%L,/etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/CVENDORsunXMICONSEARCHPATH/home/student/2003/a03guswi/.dt/icons/%B%M.pm:/home/student/2003/a03guswi/.dt/icons/%B%M.bm:/home/student/2003/a03guswi/.dt/icons/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%BLC_CTYPECGNOME_KEYRING_SOCKET/var/tmp/keyring-6VSyxE/socketUTDEVROOT/tmp/SUNWut/sessions/34/unitSTART_SPECKEYSDnoSESSIONTYPEaltDtDTAPPSEARCHPATH/home/student/2003/a03guswi/.dt/appmanager:/etc/dt/appconfig/appmanager/%L:/etc/dt/appconfig/appmanager/C:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/CDTUSERSESSIONa03guswi-frigg-34OPENWINHOME/usr/openwin_/usr/bin/gnome-sessionDESKTOP_STARTUP_IDSDT_NO_TOOLTALK1MACHTYPEsparcSHELL/bin/tcshSESSION_MANAGERlocal/frigg:/tmp/.ICE-unix/22161,inet6/frigg:38974,inet/frigg:38975G_FILENAME_ENCODING@locale,UTF-8SUN_SUNRAY_TOKENpseudo.080020b9346f
and so on...
I want to insert an "=" between capitalized letters and none capitalized
letters. That maybe isn't a problem, but how would you know for sure where
to end att for example bindings and but a "\n" between bindings and
UTAUDIODEV ?
/G
http://www.varupiraten.se/
[Back to original message]
|