Talk:Bash programming/Introduction

From Wikiversity
Jump to navigation Jump to search

Editorial remark: Since a great deal of bash (or any) shell programming may be done without invoking the sh-bang idiom, I feel it is entirely inappropriate for the first (or second) lesson in a shell programming course.

If a user needs to learn how to program the shell, a much better first lesson is the function "helloWorld".

  • it captures a command typed at the command line
  • it is more transparent than the sh-bang idiom. every syntactic element has an immediate purpose, the "#!" while necessary in some contexts (python, perl, php) is not an essential shell feature.
  • it saves the lesson of "which shell are you using" to a later and more appropriate context: moving from your command line to an industrial strength system
  • the function is immediately more extensible (the introduction of positional parameters)
  • it defers the lesson of "what goes in this file" to a more appropriate context: what functions constitute an application

(The preceding unsigned comment was added by Applemcg (talkcontribs) 4 January 2016)

@Applemcg: Be bold! Implement your suggestion. -- Dave Braunschweig (discusscontribs) 20:27, 4 January 2016 (UTC)[reply]