To run a shell script, you must specify where the program resides.
If you put it somewhere other than the directory contained in the environment variable PATH, you must specify the program in the absolute or relative path.
"The ""aaa"" we created this time is in the current directory, so you can specify the following to run it:
$./aaa
As a supplement, after you create a program (shell script), you must first have chmod
to execute it.
$chmod+xaaa
Additionally, #!/bin/sh
should not be entered directly from the terminal, but should be written to the file using a text editor (for this example, create a file called "aaa" and put it in it).
© 2024 OneMinuteCode. All rights reserved.