该脚本有错
【程序编程相关:Programming in Lua翻译】#pg dbase_add 【推荐阅读:Programming in Lua翻译】
【扩展信息:Programming in Lua翻译】#!/bin/sh#dbase_add #add a record #ignore signals trap "" 2 3 15 #temp hold files dbfile=dbfile hold1=hold1.$$read_a_char()
{ savedstty=`stty -g` stty cbreak dd if=/dev/tty bs=1 count=1 2> /dev/null stty -cbreak stty $savedstty }continue_promptyn()
_str= _default= if [ $# -lt 1 ]; then echo "continue_prompt: i need a string to display" return 1 fi while : do echo -n "$_str [y..n] [$_default]:" read _ans : $ if [ "$_ans" = "" ]; then case $_ans in y) return 0;; n) return 1;; esac fi case $_ans in y|y|yes|yes) return 0 ;; n|n|no|no) return 1 ;; *)echo "answer either y or n,default is $_default" ;; esac echo $_ans done }continue_prompt()
{ echo -n "hit any key to continue.." dummy=`read_a_char` }... 下一页