/^$/ matches a blank line, /^\$/ will do the job for you.
$ is a metacharacter, you will have to escape it. It matches at the end of a
line or before newline at the end.

hth.
Sudarsan

Tanya Bar wrote:

>
> Path could be physical or start with  environment  variable; so in my script
> I'm trying to check if the first character of $path is "$";
> I tried it this way :
> if ( "$path" =~ /^$/ ) {
>            printf("path is env var\n");
>            }
>            else {
>             printf ("working on phys.dir\n");
>            }
> And it's not working.
> What's wrong ?
> Thanks in advance.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to