[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: loginfo parameters - I Think I Figured It Out

From: CORUM, M E [AG/1000]
Subject: RE: loginfo parameters - I Think I Figured It Out
Date: Wed, 15 Aug 2001 20:30:39 -0500


I think I figured it out.  Since I only get one % parm on the line - but -
I can use a space in that line, I can do the following:

project/docs /mybin/ %{ sv} project/docs &

The %{<space>sv} gets the following into $1 in my shell script.

project/docs/use cases ,my use case.doc,1.22

Therefore, I can look for the <space>comma to separate where the 
directory structure ends and the files begin.  This will do the trick.

Thank you for your responses.  They helped me to organize my thoughts
toward a solution.

Mike Corum

-----Original Message-----
From: CORUM, M E [AG/1000]
To: 'Chris Cameron '; CORUM, M E [AG/1000]; ''Jennifer Hamilton ' ';
'address@hidden '
Sent: 8/15/01 8:13 PM
Subject: RE: loginfo parameters - plus more info


Thanks, I copied your line out and into my Bourne shell script and
it got a syntax error.  (syntax error at line 17: `BODY=$' unexpected)
I changed it to: BODY=`cat -` and it worked without a syntax error but
it still didn't actually put anything into the variable - unless I
specifically echo something and pipe that into the script in my
loginfo line.

However, I've learned a few things from the Cederqvist that almost get
me there.  Apparently, I can either get the directory reliably (with no
idea what the files are) or the file (without any idea where the
ends and the file starts).

I can do this in loginfo:

project/docs  echo %{} | /mybin/ project/docs %{sv} &

in which case, the first %{} is translated perfectly into just the 
directory.  Using my example below, standard input is:
/project/docs/use cases
as I was hoping for and I indeed can do a read and get this.
However, CVS doesn't translate the second occurrence of the % for me.
So the %{sv} comes through as a $2 parm in my script but not translated,
just as %{sv} literally.  I can reverse the two and it appears that
CVS translates only the first occurrence of this on the line.  
Unfortunately, I need -both-, not just one or the other.  I can also
do this:

project/docs  /mybin/ %{} project/docs %{sv} &

and only the first %{} is translated into the directory but the %{sv}
comes through literally and not translated.  Or I can do this:

project/docs  /mybin/ %{sv} project/docs %{} &

and the first %{sv} is translated (but with the problem of the missing
last slash to tell me where my directories end and files start) but the
%{} is not translated.  This is frustrating.

Thanks for your help, it is spurring my thought processes to get closer.


-----Original Message-----
From: Chris Cameron
To: CORUM, M E [AG/1000]; 'Jennifer Hamilton '; address@hidden
Sent: 8/15/01 7:54 PM
Subject: RE: loginfo parameters

We use the following line in our shell script to read the standard input
(from memory you can't just read lines in):
BODY=$(cat -)

Chris Cameron                       Open Telecommunications Ltd
Product Manager                           IN Product Management
address@hidden                           P.O.Box 10-388
      +64 4 495 8403 (DDI)                          The Terrace
fax:  +64 4 495 8419                                 Wellington
cell: +64 21 650 680                                New Zealand
Life, don't talk to me about life ....(Marvin - HHGTTG)

> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf
> CORUM, M E [AG/1000]
> Sent: Thursday, 16 August 2001 11:34 a.m.
> To: 'Jennifer Hamilton '; CORUM, M E [AG/1000]; 'address@hidden '
> Subject: RE: loginfo parameters


> The loginfo doc says that my script should expect something on
> standard input.  If I do a read in my Bourne shell script, I get an
> error about a broken pipe (meaning standard input had nothing) and
> nothing is read into the variable.  It would be great if the commit
> output I see on the screen would be sent into my shell script somehow
> because the file name has the critical last slash in the directory
> hierarchy before the file name itself.  Should I not be using the
> read statement?  I don't know.  Thanks for replying.
> Mike
> -----Original Message-----
> From: Jennifer Hamilton
> To: CORUM, M E [AG/1000]; address@hidden
> Sent: 8/15/01 6:17 PM
> Subject: RE: loginfo parameters
> If loginfo is a shell script, perhaps you use the escape character "\"
> to show that the space should be used literally.
> example,
> /project/docs/use\ cases/my\ use\ case.doc
> Jen
> -----Original Message-----
> From: CORUM, M E [AG/1000] [mailto:address@hidden
> Sent: Wednesday, August 15, 2001 3:46 PM
> To: 'address@hidden'
> Subject: loginfo parameters
> I'm trying to use loginfo to run a script that exports a file out and
> then copies it somewhere.  The problem is that the project team must
> use spaces in its directories and file names.  When the parameter for
> the file name (%s) comes into the script, the last slash is removed
> only a single space separates the directory from the file name.  If
> both the directory and file name have spaces, there is no way to tell
> where the directory ends and the file name begins:
> /project/docs/use cases/my use case.doc
> gets handed into the loginfo script as:
> /project/docs/use cases my use case.doc
> Can anybody help here?  Is there some secret way to have it just hand
> in the directory in a parm?  I can't hard-code the directories into
> the loginfo file because they will be adding new directories hourly
> and I wouldn't be able to keep up with their requirements for adding
> new lines into the loginfo script.  The online version of the Fogel
> book implies that there are two spaces between the directory and the
> list of files but that is not the case in 1.10.
> Any help would be appreciated.
> Mike
> _______________________________________________
> Info-cvs mailing list
> address@hidden
> _______________________________________________
> Info-cvs mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]