I can create a link and automated run program on start.
How i can put some options to runed program?
.
How changing terminal first information?
I can create a link and automated run program on start.
How i can put some options to runed program?
.
How changing terminal first information?
Add a link to the app into ~/config/settings/boot/launch/
Needs the app to be started from Terminal. Or create a script with the command line.
You mean the āWelcome to the Haiku shellā?
Thatās part of /boot/system/settings/etc/profile
. Not sure, but you can try blacklisting that file and provide an alternative in the ānon-packagedā hierarchy.
Make a bash script:
#!/usr/bin/env bash
<command> <arguments>
Save it. Make sure to run chmod on it from Terminal to make executable:
chmod +x <script_name>
If you want this script to run at boot, put it in the ~/config/settings/boot/launch directory. You can add as many things as you want to run at start in this script.
Iām pretty sure that the profile in non-packaged overrides the one in system without blacklisting. Since system is read only, this will need to be in the ~/config/settings/non-packaged. I think thatās the correct path from my memory. Iām away from my computer.
this is not a solution, this is only way to run without parameter or parameter inside program
This is a solution, and itās the solution that other OS use to start a program with or without parameters, unless there is a systemwide service controler like initv or systemd.
As far as I am understanding, this is the solution. Perhaps give an example of an actual use case that you need to get working. What programs are you trying to run, with what parameters? How and when do you want them to run?
Maybe thereās some confusion as to how it functions as a solution. The OS executes script files by invoking the processor identified in that top line, when the first two characters are #!
. So a script is effectively like any program you may write, and in this way you have the ability to write a program that invokes other programs with the environment and parameters you want.
That processor can be anything that interprets a script with #
as a comment line. Python, awk, etc., but usually in practice itās the Bourne shell. Bash is a GNU implementation of the Bourne shell, and reliably available on Haiku, but like any UNIX environment, Haiku also has sh
(in this case just bash under a different name.) My shell scripts start with /bin/sh
. If you try to run a shell script in an environment where there isnāt a /bin/sh
, then there wonāt be a /usr/bin/env
either - but Iām pretty sure you could find UNIXes where bash
isnāt installed by default.
BSD is most notable. Ksh, csh, and tcsh are the popular default ones in that world. Bash is a Linux community preference and of course default in Haiku.
In haiku you can have arguments after the #! so you actually donāt need to spawn bash here:
#!program --arg1 --arg2=foo
Meybe add attribute to file and changing it from other program,
That would be my idea as well. The attribute would be editable in Tracker and in the Get Info panel.
OT and just FYI:
Bash is not just GNUās implementation of the Bourne shell, itās its successor (simply said). And /bin/sh
is not a different shell itself nor ājust bash under a different nameā, /bin/sh
starts the userās default shell (bash, ksh, tcsh, zsh, etc.) in POSIX mode. So #!/bin/sh
and #!/bin/bash
(or other) invoke different behaviors. While a script with #!/bin/bash
(or other) may include POSIX syntax, a script with #!/bin/sh
may not include Bash (or other) syntax.
Itās true that /bin/sh
is restricted syntax, but thatās a feature - it supports good programming practice, which is to use standard syntax when possible anyway. Itās the same as invoking bash --posix
.
On Haiku, /bin/sh
is a symbolic link to bash
. Since Haiku (or Linux) arenāt likely to ever provide a separate sh, I guess in that sense bash may be considered its successor there, but the same isnāt necessarily true on UNIX platforms in general.
Yes and No. /bin/sh
ās syntax shouldnāt be called ārestrictedā. Itās simply the syntax standardized in POSIX. Shells typically ship their own dialect but can be switched into POSIX mode by using sh
or an option like --posix
. /bin/sh
could be linked to any other shellās binary if that offers a POSIX mode.
Haiku and most GNU/Linux distros use GNU Bash as default shell and the GNU team uses a symlink because their Bash provides a POSIX mode. A separate sh
-binary nowadays is only needed when an operating system shall conform the Single UNIX Specification.