Summary: | Fails to execute .sh shell script file that lacks a shebang | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | David <david.cortes.rivera> |
Component: | general | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | a.samirh78, faure, kdelibs-bugs, kfm-devel, nate, ogloooglooagla, thegt1k82u |
Priority: | NOR | ||
Version: | 5.77.0 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
David
2021-01-06 17:22:43 UTC
Does it start with the shebang? (In reply to Christoph Feck from comment #1) > Does it start with the shebang? It does work when I add it. Although I'd also expect it to use the defaults if it's missing it, provided it's a .sh file. *** Bug 431244 has been marked as a duplicate of this bug. *** I suppose KIO could detect this from the file extension. I think this is not a bug, you should add a proper shebang to a shell script. (In reply to Ahmad Samir from comment #5) > I think this is not a bug, you should add a proper shebang to a shell script. Running 'sh file.sh' does not require a shebang. Neither does the software which gets the mimetypes. It may not technically require it, but it's good practice, precisely to avoid these kinds of issues. Just add the shebang. :) (In reply to David from comment #6) > Running 'sh file.sh' does not require a shebang. [...] You run `sh file.sh` from terminal, using a shell, bash, zsh...etc; but KProcess/QProcess doesn't know that, and without that info the system call it'll use fails, IIUC. (In reply to Ahmad Samir from comment #8) > (In reply to David from comment #6) > > Running 'sh file.sh' does not require a shebang. > [...] > You run `sh file.sh` from terminal, using a shell, bash, zsh...etc; but > KProcess/QProcess doesn't know that, and without that info the system call > it'll use fails, IIUC. It'd then be helpful to at least show a message to the user that it needs a shebang, instead of tying to execute it as a binary. I assume it already has the mimetype information when it attemps to run it. That's a good point, reopening (I don't know how feasible it is to actually detect the lack of shebang beforehand, but it's worth investigating). *** Bug 455551 has been marked as a duplicate of this bug. *** |