The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
FC card not working properly Mike1234 HP-UX 4 07-16-2008 12:42 AM
Cron - Not working properly risshanth HP-UX 23 10-31-2007 06:34 AM
Telnet is not working properly deepak_pathania UNIX for Dummies Questions & Answers 1 10-05-2007 06:59 PM
y is this not working properly? C|[anti-trust] High Level Programming 3 05-18-2005 01:55 PM
Keyboard not working properly... timresh UNIX for Dummies Questions & Answers 2 02-25-2005 07:28 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-21-2008
Jive Spector Jive Spector is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 1
\n not working properly

Hi all,

I'm trying to generate a series of txt files starting from a plain csv file

part of my code:


Code:
#!/bin/ksh

INSTALLDIR=/Users/ME/Installdir
CSV=CSV.csv
TMP=/tmp/$(basename $0).txt
tr -s "\r" "\n" < /$INSTALLDIR/$CSV > $TMP
function  Makefiles
{
	printf '%24s:%30s\n' "sometext"
   	printf '%24s:%30s\n' "somemoretext" "$1"
        etc...
}


Problem lies in the \n of the printf bit.
I'm running this script in OSX to generate the files needed, but they're to be used in a winXP program. They generate fine in OSX but when I open them in winXP using notepad or something alike, every "new line" I should be getting is replaced by this vertical rectangle (don't know how it's actually called, but you can see them e.g. in fonts not covering all writing symbols).
Needless to say I get all my text on one line with a rectangle in between, instead of on two lines.

Any idea how to get this solved?
thanks in advance!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0