Follow us on Google+ Follow us on Facebook Follow us on Twitter

Opened 14 months ago

#653 new enhancement

Advanced shell scripting in Bdsh

Reported by: vhotspur Owned by:
Priority: major Milestone:
Component: helenos/app/bdsh Version: mainline
Keywords: gsoc16, gsoc17 Cc:
Blocker for: Depends on:
See also:

Description

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.

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 testing matrix).

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 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
Possible mentors
HelenOS Core Team, Vojtech Horky

Change History (0)

Note: See TracTickets for help on using tickets.