Using the text editor pico in the terminal, the line breaks are automatically set to LF, Unix mode. Just copy the text in Mac window and paste it to pico editing screen.


1st step

Start Terminal in Application > Utility

Click the link to install_gmt, then entire text of the install script is displayed in the browser window
Select all (command + a) and copy (command + c).
In Terminal,
[localhost/-] kojiok% pico install_gmt
In pico editing window, paste the copied text by command + v.
ctrl + O to save, then ctrl + X to close.
[localhost/-] kojiok% cat install_gmt to chek the text is saved.
The text will appear with the same line breaks as inthe browser window.

2nd step

Get an install parameter list (install_gmt_form.pl ) for you choosing the options below.
For GMT install_gmt_form.pl page, necessary changes are:
Archive: gzip
PostScropt: EPS
netCDF-3.5: Get and install
FTP: Nearest site or Hawaii when permission is denied by a near-by site.
Compiler: cc
Leave all other queries as they are on the page and OK.
The text of install_gmt_form.pl appears in your browser window,

Select all and copy.
In Terminal,
[localhost/-] kojiok% pico install_gmt_form.pl
In pico editing window, paste the copied text by command + v.
ctrl + O to save, then ctrl + X to close.
[localhost/-] kojiok% cat install_gmt_form.pl to chek the text is saved.
The text will appear with the same line breaks as inthe browser window.

You are ready to proceed section 7 in the previous page.


4. Start Terminal in Application > Utility

5. Check line breaks(or paragraph mark, CR/LF mode) in terminal.

[localhost/kojiok] cat install_gmt
[localhost/kojiok] cat install_gmt_form.pl

If the end of each line is defined by a LF (line feed: a line break code for UNIX system), each line
of text begins in a new line (like this text). If not, all lines are shown as a paragraph without
line breaks because the paragraph marks are not LF but CR (carriage return for Mac), or CR+LF
(for MS-DOS/Windows). You need to change line break codes to LF. For the other text-based
data sets, such as xyz, xy, text to plot, cpt, and so on, if you create the file in Macintosh, you
should always change the line break codes to LF.

--Please carefully keep the spacing between arguments in the commands you type.--

6. Change line break using tr command

[localhost/kojiok] mv install_gmt install_gmt.mac
[localhost/kojiok] cat install_gmt.mac | tr '\r' '\n' > install_gmt

[localhost/kojiok] mv install_gmt_form.pl install_gmt_form.pl.mac
[localhost/kojiok] cat install_gmt_form.pl.mac | tr '\r' '\n' > install_gmt_form.pl

[You can also use a text editor which can specify the type of line breaks in Save as command.]