This might shorten your cmd line a bit:

awk -F'|' '/^SITE_ID/ {print $1}

You could just eval the ouput (site_id=foo) to avoid another step
of spiting out the value.

-Jon


On Thu, Sep 15, 2011 at 9:01 AM, Nemeth, Michael Kenneth (Mike) <
[email protected]> wrote:

> Hi Neil,****
>
> ** **
>
> Thanks for your query and thoughts.  Actually this is the  command line
> that’s dumping****
>
> ** **
>
> $ export VARIABLE=`cat $KS_HOME/site_config|grep ^SITE_ID=|awk -F"|"
> '{print $1}'|awk -F"=" '{print $2}'`****
>
> ** **
>
> The escapes \ around the “ actually comes about and inserted by ksh during
> the processing I would assume.****
>
> ** **
>
> The contents of site_config is****
>
> ** **
>
> $ cat /home/ks_adm/site_config****
>
> #****
>
> # LOCATION:$HOME:8bit_Network_ID.8bit_Host_ID:NFS_KS_IP:NFS_KS_HOME****
>
> #****
>
> # 1st Field => SITE_ID=LOCATION****
>
> # 2nd Field => legacy_agere or classic_lsi or leave blank****
>
> # 3rd Field => IP Address of NFS appliance where ks_adm home resides****
>
> # 4th Field => PATH on NFS appliance where  ks_adm home resides****
>
> # 5th Field => NIS DOMAIN****
>
> # 6th Field => LDAP DOMAIN****
>
> # 7th Field => REGION .. EITHER NA, ASIA or EU****
>
> # 8th Field => Site Contact (email address's space delimited)****
>
> #SITE_ID=ALLENTOWN|legacy_agere|128.94.214.42|/user6/ks_adm|verde||NA|
> [email protected] [email protected]****
>
> #****
>
> SITE_ID=LVCC|legacy_agere|128.94.226.83|/t2usr702/home2/ks_adm|verde||NA|
> [email protected] [email protected]****
>
> pace291:/home/mknemeth:****
>
> ** **
>
> Thanks,****
>
> ** **
>
> Mike****
>
> ** **
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Neil Mahoney
> *Sent:* Wednesday, September 14, 2011 4:25 PM
> *To:* [email protected]; Nemeth, Michael Kenneth (Mike)
> *Subject:* Re: [ast-users] Possible ksh93u / u+ bug****
>
> ** **
>
> Hi Mike****
>
> ** **
>
> Do you really want to use the string \"|\" as your field separator? Because
> you have escaped the dbl-quotes, they will be part of the pattern passed
> into awk for use as FS. Surely you mean "|" and "\\" (maybe you need 3 \
> chars here to get 1 to emit).****
>
> ** **
>
> If your data is really like fld1"|"fld2, it would be better to remove the "
> chars in a sed pre-processing step, or use gsub(/"/,"", $1) or similar
> depending on exactly what is in $1.****
>
> ** **
>
> Other will have to comment on whether "|" is a valid value for FS in ast.*
> ***
>
> ** **
>
> Cordially****
>
> ** **
>
> Neil M****
>
> Evanston Illinois****
>
> will do ksh coding for hire or non-profit ;-)****
>
> ** **
>
>
>
> --- On *Wed, 9/14/11, Nemeth, Michael Kenneth (Mike) <[email protected]>
> * wrote:****
>
>
> From: Nemeth, Michael Kenneth (Mike) <[email protected]>
> Subject: [ast-users] Possible ksh93u / u+ bug
> To: "[email protected]" <[email protected]>
> Date: Wednesday, September 14, 2011, 2:05 PM****
>
> Hello,****
>
>  ****
>
> We have compiled ksh 93 u and u+ for RHEL5.0  -> Red Hat Enterprise Linux
> Server release 5.7 (Tikanga)****
>
> When running a command line such as the below.****
>
>  ****
>
> $ cat $KS_HOME/site_config|grep ^SITE_ID=|awk -F\"|\" '{print $1}'|awk
> -F\"=\" '{print $2}'****
>
>  ****
>
> Somewhere in the pipe line ksh is core dumping.****
>
>  ****
>
> Would you be so kind as to debug and diagnose?  Please let us know if you
> need any more information.****
>
>  ****
>
> Thanks you Mike****
>
>  ****
>
> Here is the stack trace from one of the core files.  ****
>
>  ****
>
> Core was generated by `/mnt/post_install/bin/wtk s/ksh93u.mc7.rhel5.debug
> -c /mn****
>
> t/post_install/bin/wtk'.****
>
> Program terminated with signal 6, Aborted.****
>
> #0  0x00002b1dc6a4d265 in raise () from /lib64/libc.so.6****
>
> (gdb) where****
>
> #0  0x00002b1dc6a4d265 in raise () from /lib64/libc.so.6****
>
> #1  0x00002b1dc6a4ed10 in abort () from /lib64/libc.so.6****
>
> #2  0x000000000051c95c in _vmbestcheck (vd=0x7bbe60, freeb=0x0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/vmbest.c:225****
>
> #3  0x000000000051ec7c in bestfree (vm=0x7bbf40, data=0x0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/vmbest.c:860****
>
> #4  0x00000000005249ea in free (data=0x0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/malloc.c:354****
>
> #5  0x00002b1dc6a4f9fa in qsort () from /lib64/libc.so.6****
>
> #6  0x00002b1dc6a4a15a in read_alias_file () from /lib64/libc.so.6****
>
> #7  0x00002b1dc6a4a2be in _nl_expand_alias () from /lib64/libc.so.6****
>
> #8  0x00002b1dc6a48b3e in _nl_find_domain () from /lib64/libc.so.6****
>
> #9  0x00002b1dc6a4847f in __dcigettext () from /lib64/libc.so.6****
>
> #10 0x00002b1dc6a96b3c in strerror_r () from /lib64/libc.so.6****
>
> #11 0x00002b1dc6a9697e in strerror () from /lib64/libc.so.6****
>
> #12 0x00000000004de1ed in _ast_strerror (err=4)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/string/strerror.c:75****
>
> #13 0x00000000004ca0bf in fmterror (err=4)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/string/fmterror.c:36****
>
> #14 0x00000000004bcc3b in errorv (id=0x1583be70
> "/mnt/post_install/bin/wtk", ****
>
>     level=3, ap=0x7fffc5fa6ef0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/misc/error.c:543****
>
> #15 0x00000000004bbc72 in error (level=259)****
>
> #16 0x00000000004de737 in nomalloc (region=0x7bbf40, type=3,
> obj=0x1582dec0, ****
>
>     disc=0x7bbee0) at
> /home/mc7/ksh/ksh93u/src/lib/libast/disc/memfatal.c:56****
>
> #17 0x000000000051eb0f in bestaddr (vm=0x7bbf40, addr=0x1582dec0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/vmbest.c:819****
>
> #18 0x000000000051ed9d in bestfree (vm=0x7bbf40, data=0x1582dec0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/vmbest.c:875****
>
> #19 0x00000000005249ea in free (data=0x1582dec0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/vmalloc/malloc.c:354****
>
> #20 0x000000000042ebed in slowexcept (iop=0x7bb2e0, type=11, data=0x0, ***
> *
>
>     handle=0x1582dec0) at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/io.c:1768*
> ***
>
> #21 0x00000000005168a1 in sfraise (f=0x7bb2e0, type=11, data=0x0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/sfio/sfraise.c:90****
>
> #22 0x00000000004fc294 in sfclose (f=0x7bb2e0)****
>
>     at /home/mc7/ksh/ksh93u/src/lib/libast/sfio/sfclose.c:152****
>
> #23 0x000000000042b380 in sh_close (fd=0)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/io.c:683****
>
> #24 0x000000000042b17f in sh_iorenumber (shp=0x7bd680, f1=39, f2=0)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/io.c:638****
>
> #25 0x0000000000471453 in sh_exec (t=0x158354c0, flags=4)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/xec.c:1639****
>
> #26 0x0000000000472438 in sh_exec (t=0x158355e0, flags=5)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/xec.c:1927****
>
> #27 0x00000000004698a1 in sh_subshell (shp=0x7bd680, t=0x15835620, flags=5,
> ****
>
>     comsub=1) at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/subshell.c:577****
>
> #28 0x0000000000444caf in comsubst (mp=0x1582d970, t=0x15835620, type=1)**
> **
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/macro.c:2099****
>
> #29 0x000000000043e48c in copyto (mp=0x1582d970, endch=0, newquote=0)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/macro.c:594****
>
> #30 0x000000000043c774 in sh_mactrim (shp=0x7bd680, ****
>
>     str=0x15835111 "VARIABLE=`cat $KS_HOME/site_config|grep ^SITE_ID=|awk
> -F\"|\" '{print $1}'|a****
>
> wk -F\"=\" '{print $2}'`", mode=-1)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/macro.c:178****
>
> #31 0x000000000044734e in nv_setlist (arg=0x15835100, flags=8832, typ=0x0)
> ****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/name.c:336****
>
> #32 0x000000000046f30e in sh_exec (t=0x158350c0, flags=4)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/xec.c:1075****
>
> #33 0x00000000004080ee in exfile (shp=0x7bd680, iop=0x1583e3d0, fno=18)***
> *
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/main.c:601****
>
> #34 0x0000000000407540 in sh_main (ac=3, av=0x7fffc5fa95d8, userinit=0)***
> *
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/main.c:373****
>
> #35 0x00000000004066a8 in main (argc=3, argv=0x7fffc5fa95d8)****
>
>     at /home/mc7/ksh/ksh93u/src/cmd/ksh93/sh/pmain.c:45****
>
> (gdb)****
>
>  ****
>
> *Michael Nemeth*
> Global Engineering Systems
>
> *[email protected]*****
>
>  ****
>
>
> -----Inline Attachment Follows-----****
>
> _______________________________________________
> ast-users mailing list
> [email protected]<http://mc/[email protected]>
> https://mailman.research.att.com/mailman/listinfo/ast-users****
>
> ** **
>
> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users
>
>


-- 

-Jon

<<image001.png>>

_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to