簡體   English   中英

如何編寫一個 shell 腳本文件可以在 Linux 中運行腳本

[英]How to write a shell script file that can run a script in Linux

我正在嘗試制作一個 .sh 文件,單擊該文件時它會在其中運行腳本。 我正在嘗試使用$ grep -r "word" /home/folder_name在給定文件夾的文件內容中遞歸地查找某個字符串值,但我不知道如何在不運行終端腳本的情況下這樣做。

對此有什么想法嗎?

Linux shell scripts can be written very basically.To make a shell script, start the script with #!/bin/sh and add normal linux commands. 這是一個簡單的解釋,但對於大多數簡單的場景來說已經足夠了。

例子:

#,/bin/sh echo "Hello, World!`

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM