You need to automate something highly repetitive with files in linux.
Learn how to create a text file and make it executable in a unix (i.e. linux or Mac) environment.
A lot of the time, the script you are willing to use exists in /usr/cenir/scripts. Try to find it there first! |
Open a terminal, change to a directory of interest and type gedit
<enter>. This opens a "notepad-like" window in which you can enter text.
This can be a script found anywhere on this site or on the www. It usually starts with a line like #!/bin/bash
Save the file (Ctrl+S). Give it the name you like (your_file_name below).
Enter the following in the terminal
chmod +x your_file_name |
chmod stands for "change mode".
in the terminal, type
./your_file_name |
The "./" at the beginning is the path to your file. "." in linux language often means "here", that is the directory you are in right now (aka current directory).
If you want to run this script from elsewhere, type the full path of the file. For instance:
/home/yourusername/scripts/your_file_name |
Any script can take "arguments". These are passed as a space-separated list, as follows:
./your_file_name file.fif option1 |
"file.fif" and "option1" are the two arguments here.
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.