Thanks Risto!! Both solutions work like a champ.

Tejas

> Date: Sat, 3 May 2008 09:56:33 -0700
> From: [EMAIL PROTECTED]
> Subject: Re: [Simple-evcorr-users] tilde in write action
> To: [EMAIL PROTECTED]; simple-evcorr-users@lists.sourceforge.net
> 
> 
> --- Tejas Patel <[EMAIL PROTECTED]> wrote:
> 
> > I've a couple of questions:
> > 
> > 1) I'm trying to define a write action and would
> > like to specify a ~ (tilde) like 
> > 
> >     action= write ~user/some.log %s
> > 
> > but SEC (perl) is not liking it. I tried using
> > glob() around it like
> > 
> >     action= write glob(~user/some.log) %s
> > 
> > 
> > but still no good. I don't want to specify the full
> > path to the user's home dir (which works) since it
> > changes based on what box SEC is run on. I'm
> > wondering how people have overcome this issue.
> 
> you can use an action definition like:
> 
> action=eval %dir (glob("~")); write %dir/some.log %s
> 
> or better yet, start SEC with the -intevents option,
> and have a rule to set this variable just once at SEC
> startup/restart:
> 
> type=single
> ptype=regexp
> pattern=(SEC_STARTUP|SEC_RESTART)
> context=SEC_INTERNAL_EVENT
> desc=Set user home dir variable
> action=eval %dir (glob("~"))
> 
> > 
> > 2) The box I'm on has multiple environments and
> > would like to have a generic rules file which I can
> > use for all environments. Is there a way to pass a
> > variable on cmd line to SEC (or any other way)? I
> > would like to pass in the environment name like
> > foo=test1 or test2 to sec and would like to use that
> > value in the rules file to determine which
> > environment I'm working in. 
> > 
> > Thank you for any pointers you can provide.
> 
> If you are starting SEC from sh or bash, you can pass
> a shell variable to SEC with 'env' or 'export' shell
> commands. For retrieving these variables in SEC rule
> files, I would recommend to use the above rule. All
> environment variables are stored in the perl %ENV hash
> and you should have no difficulties with retrieving
> them (for example 'eval %path ($ENV{PATH})' sets %path
> to the value of the $PATH variable).
> 
> hth,
> risto
> 
> > 
> > Tejas
> > 
> > >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by the 2008
> > JavaOne(SM) Conference 
> > Don't miss this year's exciting event. There's still
> > time to save $100. 
> > Use priority code J8TL2D2. 
> >
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone>
> _______________________________________________
> > Simple-evcorr-users mailing list
> > Simple-evcorr-users@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
> > 
> 
> 
> 
>       
> ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to