Natural Shell: An Assistant for End-User Scripting

Natural Shell: An Assistant for End-User Scripting

Xiao Liu, Yufei Jiang, Lawrence Wu, Dinghao Wu
Copyright: © 2016 |Pages: 18
DOI: 10.4018/IJPOP.2016010101
OnDemand:
(Individual Articles)
Available
$37.50
No Current Special Offers
TOTAL SAVINGS: $37.50

Abstract

Scripting is a widely-used way to automate the execution of tasks. Despite the popularity of scripting, it remains difficult to use for both beginners and experts: because of the cryptic commands for the first group, and incompatible syntaxes across different systems, for the latter group. The authors introduce Natural Shell, an assistant for enabling end-users to generate commands and scripts for various purposes. Natural Shell automatically synthesizes scripts for different shell systems based on natural language descriptions. By interacting with Natural Shell, new users can learn the basics of scripting languages without the obstacles from the incomprehensible syntaxes. On the other hand, the authors' tool frees more advanced users from manuals when they switch shell systems. The authors have developed a prototype system and demonstrate its effectiveness with a benchmark of 50 examples of popular shell commands collected from online forums. In addition, the authors analyzed the usage of Natural Shell in a lab study that involves 10 participants with different scripting skill levels. Natural Shell effectively assists the users to generate commands in assigned syntaxes and greatly streamlines their learning and using experience.
Article Preview
Top

Introduction

The command line interface is essential for users and administrators, as it allows them to fully harness and customize the power of operating systems (Robbins & Beebe, 2005). Shell scripting significantly extends the utility of the command line by automating a batch of commands. However, despite the popularity that shell script enjoys, its syntax is cryptic for beginners and it requires quite a bit of practice before they can put down the manual.

Shell scripting is complicated, because of the rigid syntax and the inconsistency between shell systems. Most commands have “options”, which significantly change and extend the functions of commands. However, the use of options is excessively succinct and thus, makes the commands incomprehensible for newcomers to a particular shell. Besides, the large amount of options that each command accepts, adds more cognitive load during the learning process. Take the grep command as an example, there are 47 options that grep accepts including popular ones like “-i” for case-insensitive, “-r” for recursive search, and “-w” for word only. It is difficult for novices to remember more than a few, and for experts to remember all the options. Moreover, this situation compounds when a user has to get accustomed to the syntax of some other shell as she switches to another shell system. If a Linux user wants to delete a directory in MS Windows, she may encounter difficulties, since MS Windows Command Prompt adopts del rather than rm, as the command to perform delete operations. Other superficial differences include argument position, case-sensitivity, options for commands instead of separate commands, etc. Even within the UNIX-like OS family, there are Ksh, Csh, Bash, and Zsh shells, each of which has its own features. Because of the difficulties engendered by shell scripting, there is a need for a “unified shell”.

Table 1.
Natural language descriptions and the associated Shell/Batch commands
Natural Language Descriptions: Remove Directories that Contain “foo” in the Name
Csh: if grep $name “foo” rm -r $name endif
Bash: if grep $name “foo” rm -r $name fi
Batch: if FINDSTR /r %name “foo” RD /s/q %name

Previous efforts have focused on whether to set up a reasoning system for UNIX Shells, or how to augment the UNIX shell with more powerful functions. Lee proposed a natural interface for shell scripting that can reason based on pre-defined cases (Lee & Lee, 1995). The reasoning system behind the interface generates scripts for seasoned users, but it overlooks the uninitiated users. Weaver et al. (Weaver & Smith, 2012) presented another UNIX text-processing tool that extends the original shell to support frequent manipulations on text files. However, their tool is platform-sensitive. We believe that a cross-platform system can handle more cases and be particularly useful for those who work across multiple operating systems.

Natural language is recognized as a more versatile method for beginners to work with programming tasks (Ballard & Biermann, 1979; Dijkstra, 1979; Brill, 1992). The way people perceive knowledge with natural language descriptions differs from that using strict and unintuitive scripting commands and their arcane outputs. Comparisons using different dimensions were discussed including simplicity, affordance, memorability, and common results, concluding that natural language has clear advantages.

Complete Article List

Search this Journal:
Reset
Open Access Articles: Forthcoming
Volume 6: 2 Issues (2017)
Volume 5: 1 Issue (2016)
Volume 4: 2 Issues (2015)
Volume 3: 2 Issues (2014)
Volume 2: 2 Issues (2012)
Volume 1: 2 Issues (2011)
View Complete Journal Contents Listing