Re: Strange error running scripts. without #!/usr/bin/bash

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

 



You should be able to add -f (follow all forks) on strace and it will
follow everything.   But without the script tracing POC mentions you
aren't really going to know what line gets the error.

It is likely the bug is in one of the commands you are using, and it
may depend on the data you are getting and processing.

On Sun, May 21, 2023 at 4:39 PM Patrick O'Callaghan
<pocallaghan@xxxxxxxxx> wrote:
>
> On Mon, 2023-05-22 at 07:09 +1000, Michael D. Setzer II via users
> wrote:
> > Located the earlier script. It still gave the error so tried
> > strace and got
> > strace ./mktext2x.sh
> > execve("./mktext2x.sh", ["./mktext2x.sh"],
> > 0x7ffc37e55570 /* 35 vars */) = -1 ENOEXEC (Exec
> > format error)
> > strace: exec: Exec format error
> > +++ exited with 1 +++
> > But running the corrected one ran fine as is and with
> > strace.
> >
> > But then tried to run it again, and mktext2x.sh runs
> > without error?
> >
> > Running the one with bash line, strace works fine.
> > strace ./mktext2.sh
> > execve("./mktext2.sh", ["./mktext2.sh"], 0x7ffc9afbcb80
> > /* 63 vars */) = 0
> > brk(NULL)                               = 0x55a016794000
> >
>
> AFAIK what you're tracing here is the Shell itself, not the script
> (except indirectly), which is unlikely to be useful in most cases.
>
> You can do some tracing of Shell scripts. See for example
> https://www.tecmint.com/trace-shell-script-execution-in-linux/
>
> poc
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux