
求教大神帮忙,用linux的shell编写一个程序,在当前目录下创建用户可读写文件“hello.txt”,
在其中写入“Hello,softwareweekly”,最后关闭这个文件。财富值不多,见谅。。...
在其中写入“Hello, software weekly”,最后关闭这个文件。财富值不多,见谅。。
展开
4个回答
展开全部
1:打开一个记事本文件,保存为hello.sh,内容为:
#/bin/bash
touch hello.txt #创建一个hello.txt文件
echo “Hello, software weekly” >> hello.txt #将“Hello, software weekly”重定向到hello.txt里面
2:保存之后,在Linux里面按照如下命令执行:
./hello.sh
#/bin/bash
touch hello.txt #创建一个hello.txt文件
echo “Hello, software weekly” >> hello.txt #将“Hello, software weekly”重定向到hello.txt里面
2:保存之后,在Linux里面按照如下命令执行:
./hello.sh
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
直接用shell命令就好了
echo "Hello, software weekly" > hello.txt
echo "Hello, software weekly" > hello.txt
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
#!/bin/sh
echo "Hello, software weekly" > hello.txt
echo "Hello, software weekly" > hello.txt
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |