Script
From MEPIS Documentation Wiki
A script is an interpreted program that can be written directly from a keyboard. The default script interpretor in MEPIS is Bash. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A shell script is the Linux counterpart of batch programs in the Windows world.
[edit]
How to write a bash script
- Edit a file with any text editor. KWrite is the default choice for a GUI test editor, for console based text editor you can use nano.
- Add #!/bin/bash line at the top of the file
- Add the rest of the commands and save the file
- Make the file executable (see below)
[edit]
How to execute a script
- You need to make sure that the script is executable, from console execute a command like "chmod +x scriptname" or using GUI: in File manager right-click on the file -> Proprieties -> Permission tab -> Select checkbox "Is executable" -> OK
- Run the script by specifying the full path, e.g., /home/user/scriptname as an alternative you can use the more convenient format ./scriptname but only if the current directory is the directory in which the script is located, "./" being a shortcut for "current directory".
[edit]
Links
See also Bash commands and Bash.

