The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: why
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-26-2007
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 707
Hi.

I would discourage the use of (t)csh for scripting, but if you must use it, you could try using the non-built-in echo:
Code:
#!/bin/csh

# @(#) s1       Demonstrate stand-alone echo.

echo
echo $version | fmt
echo

echo -e '\n\t' "No disk capacity more than 80%" '\n'

/bin/echo -e '\n\t' "No disk capacity more than 80%" '\n'

exit 0
which produces:
Code:
% ./s1

tcsh 6.13.00 (Astron) 2004-05-19 (i386-intel-linux) options
8b,nls,bye,al,ng,rh,nd,color,filec

-e \n\t No disk capacity more than 80% \n

         No disk capacity more than 80%
and also:
Quote:
echo [-n] word ...
Writes each word to the shell's standard output, separated by
spaces and terminated with a newline. The echo_style shell
variable may be set to emulate (or not) the flags and escape
sequences of the BSD and/or System V versions of echo; see
echo(1).

-- excerpt form man tcsh
cheers, drl