From: Pankaj on 11 Feb 2010 15:56 Greetings, I have a environment file in my test directory on DEV host $ ls -ltr /dev/test/env_test $ rwx------ 1 May 11 2006 env_test But if I try to access this file in a script I get file not found error $ cat test.ksh #! /bin/ksh -p .. /dev/test/env_test $ test.ksh test.ksh[2]: /dev/test/env_test: not found I am working on this for an hour now. What is going on? Any help would be appreciated. I am running it under a solaris box in ksh
From: Seebs on 11 Feb 2010 16:06 On 2010-02-11, Pankaj <harpreet.noni(a)gmail.com> wrote: > I have a environment file in my test directory on DEV host > $ ls -ltr /dev/test/env_test > $ rwx------ 1 May 11 2006 env_test Uh. "/dev" is, on at least some machines, a deeply magical thing which is not an ordinary filesystem. I would never in a million years store an environment file in /dev. I don't know if that's your problem, but the very first thing I'd try would be to put the file in /tmp and try it there. -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 11 Feb 2010 16:31 On Feb 11, 4:06 pm, Seebs <usenet-nos...(a)seebs.net> wrote: > On 2010-02-11, Pankaj <harpreet.n...(a)gmail.com> wrote: > > > I have a environment file in my test directory on DEV host > > $ ls -ltr /dev/test/env_test > > $ rwx------ 1 May 11 2006 env_test > > Uh. > > "/dev" is, on at least some machines, a deeply magical thing which is > not an ordinary filesystem. > > I would never in a million years store an environment file in /dev. > > I don't know if that's your problem, but the very first thing I'd try > would be to put the file in /tmp and try it there. > > -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, it does not even work if I put it in another directory. Same error again.
From: Seebs on 11 Feb 2010 16:43 On 2010-02-11, Pankaj <harpreet.noni(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-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 11 Feb 2010 17:00 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.
|
Next
|
Last
Pages: 1 2 3 4 Prev: Aliasing cd to a function under ksh88 Next: Wait for a process from a different shell |