[gradsusr] How to use superscript & subscript in a shell script

Huddleston, John Huddleston at cira.colostate.edu
Wed Mar 30 11:30:31 EDT 2011


Kumar

A backquote in a shell (K-shell) script tells the shell to execute the exclosed characters as a command.

In your example the shell script will try to execute a command bRef2 and a command bRBS2.

In the shell script, you can 'escape' the functionality of the backquote using the backslash character.

echo "draw title Precip diff \(mm/d\), Model\`bRef2\`n - Model\`bRBS2\`n"

Note the escape for the parenthesis since that is also a special character.

Similarly, you can use the single quote to encase your original expression without using backquotes;
however, script variables ${var} are not interpreted in single quotes.

See http://linuxreviews.org/beginner/Bash-Scripting-Introduction-HOWTO/en/x303.html

John

From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Pankaj Kumar
Sent: Wednesday, March 30, 2011 8:01 AM
To: GrADS Users Forum
Subject: [gradsusr] How to use superscript & subscript in a shell script

Dear All,
I want to use  superscript & subscript in my shell script. I am trying this

draw title Precip diff (mm/d), Model`bRef2`n - Model`bRBS2`n

it is should write as below

Precip diff (mm/d), ModelRef2 - ModelRBS2

But this is not working in my shell script (K-Shell) whereas when I am trying the same in a gs file it is working perfectly....
Can any one suggest me how to use supper and sub script commands in shell scripts!!!

With thanks and regards,
Pankaj Kumar

--



Dr. Pankaj Kumar



Max Planck Institute for Meteorology &

Climate Service Center (CSC)



Bundesstrasse 53

20146 Hamburg, Germany



Tel. : +49 40 41173411

Fax. : +49 40 41173357


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110330/25edfbf9/attachment-0003.html 


More information about the gradsusr mailing list