What’s the extension for beos script files and is the entire scripting api present in haiku
Unlike other operating systems, Haiku does not rely on filename extensions to identify the type of file so a script can have any name. Haiku uses a bash shell for scripting, although python and yab scripts are also available, and Haiku apps have a scripting inbterface exposed with the hey command.
Thanks for that
Scripts can be automatically identified, thanks to the power of the BFS. However, as with other systems, you can always decide to add .sh or the longer .shellscript ending, etc. to define a Unix shell script (bash is included on Haiku) if you want to.
Scripts are just text/plain files, so mime sniffing etc. won’t help you identify a script. You don’t have to, but it’s tradition to use the suffix .sh for (bash) scripts. And bash is Haiku’s default shell, so esp. if you plan to share your scripts with others, using bash scripting is easiest. Of course, there’s also python and a slew of other languages you could use…
Anyway, to make your shell scripts work, it’s most important to have the shebang in the first line - #!/bin/sh - and to have the executable bit set on the script - chmod +x scriptname.sh.
Thanks for the great answers everyone, that’s really helpfull
[quote]Anyway, to make your shell scripts work, it’s most important to have the shebang in the first line - #!/bin/sh - and to have the executable bit set on the script - chmod +x scriptname.sh.
Whate he said, You can also conveniently set the execute bit from the ‘Get Info’ panel. Use the item in the Tracker menu to open it, then click on the 'Permissions" tag to open up a list of the current permission bits on that file. Click in the ‘Owner/Execute’ box (the others are currently irrelevant in Haiku) to make it executable.