I'm a newbie ...
Within a xsd schema, I'd like to know is it possible to apply a different rule based on the actual name of the xml file I'm validating?
For example, a specific tag (eg. <devUse>) is valid only for xml files that contain "debug" in their actual xml file name. If the xml file...
Thanks guys for the responses ...
I was just trying to exclude a repeating char class,
something like this:
string: 'ABC 123 MM'
/([M]{2})+/ ## returns 'MM'
but something like this doesn't work:
/([^M]{2})+/ ## expecting 'ABC 123 '
...to capture contents seperately both before and after 'MM'. If 'MM' doesn't exist, just capture the entire string.
examples:
If 'MM' exist ...
/(.*)M{2}(.*)/
$1 = 'id <xx> '
$2 = ' blah blah'
This is ok...but obviously I have to account if 'MM' is not in string.
I've tried ...
If you test on the other side, this works:
/dog(?=\s)/
Anotherwords, it will return either dog at end of line or dog suffixed with white space(s).
So my question boils down to this:
/(?<=\s)dog/ doesn't recognize the ^ but,
/dog(?=\s)/ recognizes the $.
...Why?
Thanks for the reply ... yes it makes sense and yes, I'm well aware of the "taboo" of double-negatives ... I'm positive about that (lol)!!
I went with this /(?<!\S)dog/ because I could not get the following positive lookback alteration to work:
/(?<=^|\s)dog/ ## or any other format...
When running the following 2 lookbehind zero-width assertions :
/(?<!\S)dog/ ##Match a non-non-whitespace char
/(?<=\s)dog/ ##Match a whitespace char
... why would I get different results?
That is, the first lookbehind will match if "dog" is at the beginning of the line, the 2nd lookbehind...
Annihilannic - thanks for responding - it's been a while since I addressed this issues ... I've moved on from this issue, as we all need to do eventually, but the geek in me would still however like to find a solution to this ...
Soooooo .....
No, /opt/ctis/adapt/ZHU is not the final file...
polar1 -
I'm not clear exactly on what you're goal is, could you be more specific?
Anyway, for starters ...
1.) your rowa & rowb variables are identical
2.) you're missing a [ and a backtic `
Also, try this:
for i in $rowb
do
if [`echo $i | /usr/xpg4/bin/egrep [[:digit:]]` = 3 ]
then...
easier to read format ??? Can you be more specific ...
How about this:
ls -Rp | egrep -v '\/$|\.:'
The "p" argument appends a slash '/' after each dir name, thus allowing the egrep -v to remove these dirs (as well as the current dir '.:' element). Otherwise, these dirs would be recursively...
Sorry Annihilannic, my bad - I took liberty on what's a VOB - it's Clearcase's version controlled files (Versioned Object Base).
Also, let me clarify with respect to the effects of a VOB file. It's not where I excute script from, it's where I'm directing the 'RDFILE' file that's an issue - if...
I'm on Solaris 9 ...
BTW, the reason why I orig. fell away from the idea of using lsof is because when I run lsof from a VOB directory, the lsof output doesn't list the redirected file name like it does when I run from a non-VOB directory ... hmmmm
Thanks guys so far, but still not working ...
my path:
/proc/$$ contains the following:
[No View Set]:betta: /proc/19845 >ls -lA
total 9215
-rw------- 1 cpver users 4685824 Nov 5 22:06 as
-r-------- 1 cpver users 152 Nov 5 22:06 auxv
-r-------- 1 cpver users 32 Nov...
Thanks guys ...
lsof is not a working as orig. thought - the expected pattern is not always consistent (on my system), thus I can't successfuilly always pattern-remove the leading chars to get at the trailing file name.
Sammy - I'm exploring your solaris idea of /proc/$$/path/1,
but I'm still...
...ahead of time. Anyway, yes I am using the -t test, but what I found that looks promising is the utility 'lsof'. By using the pid=`echo $$` shell variable with the following:
tmp=`lsof - p $pid -a -d 1` ### -a=and, -d file descr.
FD=${tmp##*/} ## removes pattern from left, returns file name
...myprogram > RDfile
Is there a way to reference the actual redirected file name 'RDfile' in the ksh script?
Built-in shell variables like $* or $@ don't include any of the tokens right of the ">" cmd.
What about referencing the file descriptor ... how? What I need is the actual file name...
Annihilannic -
You are in deed right - as I would expect it (lol)...
I'm just amazed that the definition of word-constituent characters includes only the following 3 items:
letters, digits, and the underscore.
Why not have available another word-like option switch to be defined as between...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.