Re: Running a Script- and debugging.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/23/2009 09:19 AM, Jim wrote:
On 09/23/2009 12:11 AM, Nifty Fedora Mitch wrote:
On Tue, Sep 22, 2009 at 05:17:34PM -0430, Patrick O'Callaghan wrote:
On Tue, 2009-09-22 at 15:46 -0400, Jim wrote:
Could someone give me a Ideal as to this part of a script would
hangup
script.
In FC11.

The hangup stops at;

cd 'dirname $0'
$0 is usually the name of the script itself, so 'dirname $0' is the
directory the script lives in. Changing to that directory shouldn't
normally cause a hang, unless for example the directory is NFS-mounted,
but without more information this is pure speculation.

Put some debugging in the script it is easy to make a copy.
We do not know what $0 is.

We could have changed directory as expected and the
next command is hanging ya out to dry.  What is
the next command.  Is there a "trap" that has taken
the script to someplace unexpected.

Also 'odd' things can happen if '.' and strange places
are in your PATH.   Are you running it as root via "su",
as root via "su -", as root via "sudo" or as yourself.

What is the first line. Is this a sh, bash or csh script or something else.
Some flags may be passed,

To the copy add simple commands to get you some additional
information.

Ideas....
$ cat bin/flubber
#!/bin/bash
pwd
echo foo
echo $0
dirname $0
cd 'dirname $0'
pwd

=====
$ bin/flubber
/home/mydir
foo
bin/flubber
bin
bin/flubber: line 6: cd: dirname $0: No such file or directory
/home/mydir

=====
If it "hangs" you might run it with "strace -f -o /tmp/tracelogfile script"

=====
I do recall a bug fix going into bash that fixes a standards correctness
problem but has side effects because is it not "bug" compatable.
You can grab an OLDer version of bash and install it in a SAFE place
with rpm and try it.  I just do not recall the details and they do
not matter -- it is easy to test for.  It is also easy to look at the
change log for the bash rpm and read the bug reports.  Use rpm or yum,
Example using rpm:
  # which bash
  # rpm -qf /bin/bash
  # rpm -qi bash
  # rpm -q --changelog bash



Mitch you DID IT !!  su - instead of su

Thanks guys, for all your help, I couldn't have done without it.
This Samsung CLX3175FN is one nice printer , it even checks the ink levels.
Now I'm having problems with Cups and the printer with connecting after driver setup. - SU verses SU did the the trick.
I'm going to have to do some more troubleshooting.

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux