or just run it like this from the command line without editing your file
using sh -xve your_file.
Of coarse if you do edit your file (anyfile) you do check it in to RCS first
right? So that you have a backup copy.
man RCS
RCS is a very handy tool especially when you start mucking around with
files. Not only do you get a backup of your file, if you comment your edits
and save after each checkin you endup with a nice revision history. I am
sorry this is a personal point I have to make to anyone before ever
suggesting a way to troubleshoot a file that could cause you heartburn if
corrupted or lost. It is my disclaimer to you that at least I tried to not
just warn you about backing up a file but showed you how to do it.
in the dir where the file exists.
mkdir RCS
ci -l your_file
.
to check out a file from RCS
co -l your_file
OK lets move on ...
sh -xve /usr/local/matlab5/etc/lnx86/lmhostid
(hopefully you have your environment setup so that you don't have to use
this fully qualified path to your app, but to be safe I gave you the command
as you exampled it in a previous post)
Assuming that as the other contributors stated that this is a simple shell
script, you can execute it with sh -xve
-x will show you what is being actually being executed at that time
-v verbose line by line output of the script being as it is executed and
any messages produced
-e will halt execution upon the first error encountered
with this you can "watch" the script execute and then see if it errors out
and where. Look at the line and the command that it errors on correct it
and re-run the script again repeating the process as needed until it
executes without issue.
L8TR
> If the problem is as Loren Brookes describes, open the file lmhostid in a
> text editor and see if the first line is something like #!/bin/bash. If
so,
> edit the file and change this line to #!/bin/bash -x. The -x will enable
> debugging. When the file is ran, you'll see a lot of debugging code
dumped
> to the screen, which should help you figure out if some command within the
> file is causing the problem.
> -dnult
> >>Hi all,
> >>I just installed Redhat 7.0. I would like to run a program that is
> >>called lmhostid but the shell would not find it :
> >>bash: /usr/local/matlab5/etc/lnx86/lmhostid: No such file or directory
> >>however the file exists with correct execution permissions
> >>-rwxr-xr-x 10 acizmeli users 219264 Oct 31 1997
> >>/usr/local/matlab5/etc/lnx86/lmhostid
> >>I AM COMPLETELY STUCK. WHY WOULD THE SHELL NOT FIND THIS FILE TO RUN
> >My guess would be that the file you are trying to run is a script, and it
> is
> >looking for a file, and not finding it. i.e. the error message refers to
> some
> >file other than the one you are running. If this is so you need to open
> >lmhostid with a text editor and look for the file refered to in it.
> >If it is not a script it may still be looking for some file in the wrong
> place.
> >Maybe there's some environment problem.
> >Maybe you could just uninstall and then reinstall the program, that does
> work
> >sometimes.
> >Hope this helps.
> >Loren Brookes
> >>any help would be greatly appreciated
> >>thanks from advance
> >>peace