|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
newline in echo
Hi all, I have a scripts in csh and whenI do echo command I want to add newline. I used to do it like this: Code:
#! /bin/csh echo "\n\n WHAT AREA DO YOU WANT:\n\n" echo -n " YOUR CHOISE : " set area=$< but since weupgrade the oracle to 10g it doesn't do the newline (he print the\n as a text). I try to do echo -e but the same problem (he also print the -e). the echo -e only work is sh command but not un csh witch I need in order for his to know the echo -n.... I allso try adding enter in the echo but I got error. do you know how can I do it? Last edited by Scott; 01-19-2010 at 07:10 AM.. Reason: Please use code tags |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try using /bin/echo when you want to process escape characters such as \n.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Try this: Code:
#!/bin/csh echo "" echo "" echo "WHAT AREA DO YOU WANT:" echo "" echo "" echo " YOUR CHOISE : \c" set area=$< Failing that, please state your Operating System. Last edited by methyl; 01-19-2010 at 08:54 AM.. Reason: Removed space from shebang line |
|
#4
|
|||
|
|||
|
Thanks
I dont want to do echo "" for each enter because this is a long script and it will be even longer.
our system change to RHEL. from some serch I saw thet there may by an envairment that I need to add to the script but I dont know what (still looking) if you have some idea or other ideas I will be happy to try it. |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
you can write a function which will print the output in desired format and then you can call this function instead of echo. something like.. Code:
function echo2()
{
echo ""
echo "$1"
echo ""
}
echo2 "print this"please ignore the syntax error, not sure if its correct. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
not so practical
I have some menu and it goes from one to one (depent of the user choise) so I will have to get lt of functions...
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to correctly use an echo inside an echo? | mokachoka | UNIX for Dummies Questions & Answers | 3 | 09-19-2009 11:40 PM |
| Difference between using "echo" builtin and /bin/echo | ulidtko | Shell Programming and Scripting | 2 | 07-15-2009 11:12 AM |
| echo without newline character | srilaxmi | UNIX for Dummies Questions & Answers | 2 | 11-10-2008 11:11 AM |
| replace a newline (\n) | jeter | Shell Programming and Scripting | 3 | 05-18-2008 10:37 PM |
| newline | Gale Gorman | Forum Support Area for Unregistered Users & Account Problems | 2 | 05-04-2008 12:23 PM |
|
|