1)接收输入 check_status() { echo --Check hi_repo status is ok? y or n read var if [ "$var" != "y" ] then echo --input is not 'y' exit fi } 1.编写函数check_status,调用时直接写check_status,不用括号: 2.输入read var, 使用时用$var 3.if判断,可以用!=,注意if []的空格: 2)删除空行 #…
用sed删除空行 我的代码如下:class Song def initialize(name) @name = name end def tell puts @name end end class ZhouSong < Song def initialize(name,artist) super(name) @artist = artist end def tell super puts @ar…