From: Seebs on
On 2010-02-11, Pankaj <harpreet.noni(a)gmail.com> wrote:
> Thanks Seebs. But it seems this is not the case as my "not found" is
> coming at the end of error line.

Perhaps. Hmm.

Okay, next thing I'd do:

Something to the effect of
file=/testing/test/env_test
ls -l "$file"
. "$file"

> Could it be the case that script is looking into another hostname than
> existing one. I mean, we have 3 regions with same directory structure
> and different hostnames. Could be the possibility, that the
> environment is pointing to some other hostname than where it is
> currently running? Just a guess.

I can't even comprehend what you just said. Host *names* are irrelevant.
It is conceivable that you're running the script on a different host than
you're checking for the exisence of env_test on -- thus the suggestion that
you have the script do an "ls -l" itself to verify that the file exists.

If it can't do that, have a look at the first few lines of env_test, in case
something in there is causing a problem. I can't imagine what it would
be...

Oh, and check permissions -- make sure the script is running as the user
that owns env_test, because you showed it being rwx------, and that would
be inaccessible to anyone but the owner.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Pankaj on
On Feb 11, 5:00 pm, Pankaj <harpreet.n...(a)gmail.com> wrote:
> On Feb 11, 4:43 pm, Seebs <usenet-nos...(a)seebs.net> wrote:
>
>
>
>
>
> > On 2010-02-11, Pankaj <harpreet.n...(a)gmail.com> wrote:
>
> > > Seebs, it does not even work if I put it in another directory. Same
> > > error again.
>
> > Hmm.
>
> > I can't reproduce this.  I'm not on the same host, obviously, but:
>
> > $ cat /tmp/env_test
> > echo "got here!"
> > $ cat test.ksh
> > #!/bin/ksh
> > . /tmp/env_test
> > $ ksh test.ksh
> > got here!
>
> > Okay, next thing to check:  Verify that your script isn't, say, a DOS-format
> > file with ^Ms at the ends of lines, because that will do this:
>
> > $ ksh test.ksh
> > : not found: .: /tmp/env_test
>
> > Note the "not found" showing up before the name because there is a carriage
> > return at the end of the name.
>
> > -s
> > --
> > Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...(a)seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
>
> Thanks Seebs. But it seems this is not the case as my "not found" is
> coming at the end of error line.
>
> test.ksh[2]: /testing/test/env_test:  not found
>
> Could it be the case that script is looking into another hostname than
> existing one. I mean, we have 3 regions with same directory structure
> and different hostnames. Could be the possibility, that the
> environment is pointing to some other hostname than where it is
> currently running? Just a guess.- Hide quoted text -
>
> - Show quoted text -

The reason I am saying is becasuse the same script with same settings
of env variable and directory structure, runs fine in PROD region. I
am not sure what exactly is the issue with DEV host?
From: Pankaj on
On Feb 11, 5:01 pm, Seebs <usenet-nos...(a)seebs.net> wrote:
> On 2010-02-11, Pankaj <harpreet.n...(a)gmail.com> wrote:
>
> > Thanks Seebs. But it seems this is not the case as my "not found" is
> > coming at the end of error line.
>
> Perhaps.  Hmm.
>
> Okay, next thing I'd do:
>
> Something to the effect of
>         file=/testing/test/env_test
>         ls -l "$file"
>         . "$file"
>
> > Could it be the case that script is looking into another hostname than
> > existing one. I mean, we have 3 regions with same directory structure
> > and different hostnames. Could be the possibility, that the
> > environment is pointing to some other hostname than where it is
> > currently running? Just a guess.
>
> I can't even comprehend what you just said.  Host *names* are irrelevant.
> It is conceivable that you're running the script on a different host than
> you're checking for the exisence of env_test on -- thus the suggestion that
> you have the script do an "ls -l" itself to verify that the file exists.
>
> If it can't do that, have a look at the first few lines of env_test, in case
> something in there is causing a problem.  I can't imagine what it would
> be...
>
> Oh, and check permissions -- make sure the script is running as the user
> that owns env_test, because you showed it being rwx------, and that would
> be inaccessible to anyone but the owner.
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...(a)seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Seebs, I tried that. and again got the error message

$ file=/testing/test/env_test
$ ls -l "$file"
-rwx------ 1 32471 3277 May 11 2006 /testing/test/env_test
$ . $file
ksh: /testing/test/env_test: not found
$


Ah, the permission part I have not taken into consideration. Actually,
this script is owned by another user and I am trying to run it using
my own credentials. Could this be the issue?
From: Seebs on
On 2010-02-11, Pankaj <harpreet.noni(a)gmail.com> wrote:
> $ file=/testing/test/env_test
> $ ls -l "$file"
> -rwx------ 1 32471 3277 May 11 2006 /testing/test/env_test
> $ . $file
> ksh: /testing/test/env_test: not found
> $

> Ah, the permission part I have not taken into consideration. Actually,
> this script is owned by another user and I am trying to run it using
> my own credentials. Could this be the issue?

Yes. Note that it's "-rwx------". That means only that user can read
it or execute it. Although my ksh helpfully says:

test.ksh[2]: .: /tmp/env_test: Permission denied

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Pankaj on
On Feb 11, 5:42 pm, Seebs <usenet-nos...(a)seebs.net> wrote:
> On 2010-02-11, Pankaj <harpreet.n...(a)gmail.com> wrote:
>
> > $ file=/testing/test/env_test
> > $ ls -l "$file"
> > -rwx------   1 32471        3277 May 11  2006 /testing/test/env_test
> > $ . $file
> > ksh: /testing/test/env_test:  not found
> > $
> > Ah, the permission part I have not taken into consideration. Actually,
> > this script is owned by another user and I am trying to run it using
> > my own credentials. Could this be the issue?
>
> Yes.  Note that it's "-rwx------".  That means only that user can read
> it or execute it.  Although my ksh helpfully says:
>
> test.ksh[2]: .: /tmp/env_test: Permission denied
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...(a)seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Thanks Seebs But isnt the error message I am getting is a bit
"misleading"? I mean why am I not getting "permission denied" as you.
"Not found" error makes a total different meaning here.