[Samba] Can't print properly through server, only direct client->printer

Simon Hobson shobson-lists at colony.com
Thu Sep 2 16:12:02 GMT 2004

Doug VanLeuven wrote:

>>print command = grep -v '^[0-9]* *VM\?' <%s >%s-2 ; rm %s ; lpr 
>>-P%p -o raw %s-2

>I read ^[0-9]* *VM\? as
>match 0 or more occurances of a digit at the beginning of a line
>match zero or more occurances of a space
>match a V
>optionally match one M (shell interpretive issues with backslash and ?)
>3V)_ and 9VL@ both meet that criteria.
>^[0-9]+ +VM\\[?]
>if you're looking for
>0 VM\?
>I find it helpful to eliminate shell issues by making special 
>characters in a class
>       A regular expression may be followed by one of several repetition oper-
>       ators:
>       ?      The preceding item is optional and matched at most once.
>       *      The preceding item will be matched zero or more times.
>       +      The preceding item will be matched one or more times.

Just goes to show what a fresh pair of eyes can spot !

Interestingly, I tried [0-9]+ and it doesn't select anything, whereas 
[0-9][0-9]* does. And now I see why VM\? failed, the \ was to escape 
the ?, and I overlooked the meaning of ?

Anyway, I settled on '^[0-9][0-9]* VM[?]^M$' (where the ^M is a 
return, not two characters) which should be safe - I think in the 
past I must have tried $^M which of course doesn't work.

Just proves that most of us still have plenty to learn !

Thanks, Simon

Simon Hobson MA MIEE, Technology Specialist
Colony Gift Corporation Limited
Lindal in Furness, Ulverston, Cumbria, LA12 0LD
Tel 01229 461100, Fax 01229 461101

Registered in England No. 1499611
Regd. Office : 100 New Bridge Street, London, EC4V 6JA.

More information about the samba mailing list