replace space for enter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting replace space for enter
# 8  
Old 07-14-2010
Hi pseudocoder. Not exactly. It is the other way around. When you assign the output to a variable, the newline characters are retained. If you later echo that variable without quotation they are converted to spaces. If you echo the variable with quotation the newline characters are not converted to spaces.

Last edited by Scrutinizer; 07-14-2010 at 06:59 PM..
This User Gave Thanks to Scrutinizer For This Post:
# 9  
Old 07-14-2010
Better to do it right the first time

why not try something like:
Quote:
listado= '
<p>'

for foo in `find $direcreal -type f -print` ; do

listado="${listado} </b>${foo}
"

done

listado="${listado} </p>"
or something of the kind. The exact formatting is not critical, but that it be correct html or xhtml to display properly when written to the html page and rendered in a browser does!

Check into other options, like wrapping it in
Quote:
<pre> </pre>
tags as another option.

(Note, you can load the variable as you did, then parse and format it on output. This was just one example.)

Last edited by wpeckham; 07-14-2010 at 06:59 PM..
# 10  
Old 07-14-2010
I tried everything you all said but nothing works

---------- Post updated at 07:38 PM ---------- Previous update was at 05:21 PM ----------

Yes ! finally i find the solution
prueba=`echo "$mostrarlista" | cut -d" " -f1`
<pre>$prueba</pre>
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Loop logic, enter into respective IF as per enter input file name

have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value File 1 export SERVER_CONNECTION=//dvlna002:10001/SmartServer File2 export SERVER_CONNECTION=///SmartServer File3 export... (1 Reply)
Discussion started by: Nsharma3006
1 Replies

2. Shell Programming and Scripting

Transpose multiple rows (with a mix of space and enter) to a single column

How to change the uploaded weekly file data to the following format? New Well_Id,Old Well_Id,District,Thana,Date,Data,R.L,WellType,Lati.,Longi. BAG001,PT006,BARGUNA,AMTALI,1/2/1978,1.81,2.29,Piezometer,220825,901430 BAG001,PT006,BARGUNA,AMTALI,1/9/1978,1.87,2.29,Piezometer,220825,901430... (3 Replies)
Discussion started by: sara.nowreen
3 Replies

3. Shell Programming and Scripting

function terminating if i give input as space or no input and enter

HI i have written a script to ask input from the user. this script should promote the user for y/n input. if user enters anyother input then y/n the script promotes him again. this below code is working fine for all the cases. except for space and enter " if i give space and enter it is... (2 Replies)
Discussion started by: BHASKARREDDY006
2 Replies

4. UNIX for Dummies Questions & Answers

replace %20 with space

Hi, I need torename filenames with %20 to space in a batch wise.Can anyone help me please. Need it badly Eg. English%20Brochure%20002-1 to be replace to English Brochure 002-1 Thanks a lot Please use and tags when posting code, data or logs etc. to preserve formatting... (8 Replies)
Discussion started by: umapearl
8 Replies

5. Programming

Replace one space with nothing

hi, d o g e v o l i want a perl command for the above string which should change to the below dog evol replace one space with nothing and two spaces with one space. Thanks, Amey (3 Replies)
Discussion started by: ameyrk
3 Replies

6. Shell Programming and Scripting

Replace every other space

I'd like a sed command to replace every other space in my file. File: 0 1 0 3 0 2 0 5 Want: 01 03 02 05 Does anyone have any ideas? (9 Replies)
Discussion started by: peanuts48
9 Replies

7. Shell Programming and Scripting

Replace long space to become one space?

Hi, i have the log attached. Actually i want the long space just become 1 space left like this : Rgds, (12 Replies)
Discussion started by: justbow
12 Replies

8. Shell Programming and Scripting

Pressing "Enter/Space bar" using Net::TELNET? in Perl

I'm trying to learn how to get my script to execute the enter button when it telnets into a router and the router displays output but you need to press the space bar or enter button to continue displaying my output of the router. How is this done? (0 Replies)
Discussion started by: xmaverick
0 Replies

9. Shell Programming and Scripting

Replace space

Hai masters, If a file contains content of 2000 lines, from which i need to remove the first n characters or first n spaces from each line of the file. If suppose to remove n characters or first n spaces from a single line means, just use the command nx. But from the above scenario,... (9 Replies)
Discussion started by: ecearund
9 Replies

10. Shell Programming and Scripting

replace space by _

Hi I need to know how I change the spaces by _ in folders and filder founded by find ex. find . -name "* *" -exec echo {} \; ./test space ./test space/new file.txt ./test space/new file ./test space/untitled folder ./test space/untitled folder/new fileruben ./Backup/backup/Image... (6 Replies)
Discussion started by: ruben.rodrigues
6 Replies
Login or Register to Ask a Question