linux如何创建 shell脚本,创建了shell但保存不了

如题所述

学习一下vi命令吧
命令模式下 输入i /a 等 进入编辑模式

编辑内容

编辑模式下 键盘 Esc 进入命令模式

命令模式下, 敲入冒号 ":"然后输入wq!即可保存编辑

授执行权限给脚本(假设名为test)
chmod 755 test 或者 chmod a+x test
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-03-27
你写了之后又没有 :wq呢 保存了之后是SH 格式的
第2个回答  推荐于2017-05-21
touch test
nano test
==================
#! /bin/bash
echo "test"
==================
chmod +x test
sh ./test
相似回答