From 06a2d163f7b0ff243c3592af674f445158909ea4 Mon Sep 17 00:00:00 2001 From: almande Date: Sat, 26 Jan 2019 18:44:50 -0500 Subject: [PATCH] Fix grammar and which user executes example (#25897) I clarified the writing and added some missing articles ("the"). I also changed the description to state that the root user is running the command, based on the use of "sudo" and 744 permissions. --- guide/english/bash/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guide/english/bash/index.md b/guide/english/bash/index.md index 5a81db1662f..4a257aba080 100644 --- a/guide/english/bash/index.md +++ b/guide/english/bash/index.md @@ -43,17 +43,17 @@ It's worth noting that the first line of the script starts with `#!`. It is a sp That is because it is a convention to let the interactive shell know what kind of interpreter to run for the program that follows. The first line tells Unix that the file is to be executed by /bin/bash. This is the standard location of the Bourne shell on just about every Unix system. Adding #!/bin/bash as the first line of your script tells the OS to invoke the specified shell to execute the commands that follow in the script. `#!` is often referred to as a "hash-bang", "she-bang" or "sha-bang". + Though it is only executed if you run your script as an executable. For example, when you type `./scriptname.extension`, it will look at the top line to find out the interpreter, whereas, running the script as `bash scriptname.sh`, the first line is ignored. - -Then you could run the script like so: -For make file executable you should call this command under sudo chmod +x "filename". +For example, you can use this method to run the script as the root user: +To make the file executable call this command under sudo chmod +x "filename". ``` zach@marigold:~$ ./myBashScript.sh Hello world! ``` -The script only has two lines. The first indicates what interpreter to use to run the file (in this case, bash). The second line is the command we want to use, echo, followed by what we want to print which is "Hello World". +The script only has two lines. The first line indicates what interpreter to use to run the file (in this case, bash). The second line is the command we want to use, echo, followed by what we want to print which is "Hello World". Sometimes the script won't be executed, and the above command will return an error. This is due to the permissions set on the file. To avoid that use: ```