id summary reporter owner description type status priority milestone component version resolution keywords cc field_blocks field_dependson field_seealso 653 Advanced shell scripting in Bdsh Vojtech Horky "Implement support for control structures (loops and conditionals), variables and pipes in Bdsh (HelenOS native shell). Details:: The currently used shell in HelenOS is Bdsh. It is used to start new tasks and has basic support for redirection of standard input and output. But it does not offer any advanced features such as loops or variables. Also there is no support for pipes, i.e. redirection of output of one task to the input of another one. [[br]][[br]] The goal of this ticket is to implement a script language suitable for HelenOS shell. The shell should support at least the following functionality: * **Variables**: assign values into variables, variables would be expanded to their values when being used during task launch. * **Conditionals**: write constructs that would conditionally execute one of its branches depending on value of a variable or properties of a file (e.g. its existence). * **Loops**: specify that a certain block of commands shall be executed multiple times. * **Pipes**: output from one program would be piped to the input of another one (possibly chained multiple times). The applicant shall sketch the syntax of the scripting language as part of the proposal or (preferably) discuss it on the mailing list prior application submission. What Gains and Benefits will this bring?:: More shell features would improve the overall usability of the HelenOS terminal (console). It would be also possible to script more complex scenarios to better test HelenOS automatically. An example of such test is the //file-system test// (see information under the [[ElasticHorseRegressions|testing matrix]]). [[br]][[br]] Better scripting support would also be beneficial for the self-hosting scenario where HelenOS is supposed to be fully buildable inside HelenOS. Decent shell-scripting support is also a must-have for [[PortingSoftware|Coastline-ported software]]. Difficulty:: medium Required skills:: A successful applicant will have good skills of programming in the C language and some scripting language (Bash or similar) and the ability to survive in a non-standard non-POSIX application environment. Knowledge of parser and lexer generators (e.g. Bison or Flex) would be beneficial. Documentation:: * [[UsersGuide|User's guide]] * [[https://www.gnu.org/software/bison/|Bison]] and [[https://www.gnu.org/software/flex/|Flex]] * For inspiration: [[https://www.gnu.org/software/bash/|Bash]] and [[http://microsoft.com/powershell|PowerShell]] Possible mentors:: HelenOS Core Team, Vojtech Horky " enhancement closed major helenos/app/bdsh mainline wontfix gsoc16, gsoc17 #835