Sponsored Content
Top Forums UNIX for Advanced & Expert Users Porting of Windows written unix scripts to unix platform Post 29247 by WIntellect on Wednesday 2nd of October 2002 10:25:48 AM
Old 10-02-2002
Here's one that was shown to me; on the unix box, run this perl 1 liner from the command line - replace "dos.file" with the file to be converted from dos to unix:

perl -i -pne 's/\r\n/\n/g' dos.file

the file will then be UNIX usable

Smilie I love Perl! Smilie
 

10 More Discussions You Might Find Interesting

1. Programming

I am porting Dll from NT to Unix, how should I proceed

I am porting Dll from Windows NT to Unix, Could any body pls guide me how should I proceed?? (3 Replies)
Discussion started by: Vipin
3 Replies

2. Windows & DOS: Issues & Discussions

checking the size of unix cd on windows platform

Hi, Is it possible or is there a program out there that can get the byte size of a unix cd on the windows platform. Any help would be really great with this. Thanks (2 Replies)
Discussion started by: johnjsm
2 Replies

3. Shell Programming and Scripting

FTP Shell Scripts from Windows to Unix: files have exotic characters

Hey guys, I am working on my shell scripts in wordpad in windows. Then, I upload it to my unix using psftp, but when I open those files with "vi" in Unix, there are all these "^M" characters in the file. Would anyone of you have a clue as to why? Help would be appreciated. Thanks, Laud (4 Replies)
Discussion started by: Laud12345
4 Replies

4. Shell Programming and Scripting

Run the scripts from windows to UNIX

HI, I have one java program in windows OS. From that java program, I want to run the shell script file in the UNIX OS. Is it possible ??If yes, please post me the source code, how to do that ?? Thanks, Srinivas (3 Replies)
Discussion started by: srinivas peyyal
3 Replies

5. UNIX for Dummies Questions & Answers

porting programs with dcom to unix

Hi I have a rather large set of sas programs that i want to port to unix sas. All of these programs uses windows functionality somehow. For example win API calls and ole-dll:s via com and dcom. Now my company is moving to sas on unix, and we must port these apps (sas macros). So what Im... (3 Replies)
Discussion started by: iommi
3 Replies

6. UNIX for Dummies Questions & Answers

How can I run scripts in my unix account from batch file in Windows?

Hi all, I'm working on Windows, connecting to my Unix account by different ways: by FTP opening files in UltraEdit32, by mapping drive to browse, by Exceed or Telnet to compile at Unix account. Actually, that is what I would like to change: I'd like to make a batch file which would connect to... (7 Replies)
Discussion started by: olgafb
7 Replies

7. Shell Programming and Scripting

Compiling scripts written in Unix

I would like to convert some Unix scripts into machine language. I dont know how to programe in C. Is there any software out there that I can use to convert these Unix scripts into machine language. Thanks. (1 Reply)
Discussion started by: coburn
1 Replies

8. UNIX for Dummies Questions & Answers

Exporting Files from Unix to a Windows Platform

I was able to convert my csv file in Unix to xls. I would like to export the converted xls file to a windows environment. I have to manually connect using the following below: ftp: 192.x.x.x -> username/pass -> cd -> mget *.xls and then confirm. Could I automate this process into a shell... (4 Replies)
Discussion started by: ravzter
4 Replies

9. AIX

how to allow Windows platform to access Unix based disk volumes

How to allow Windows platform to access Unix(AIX) based disk volumes? (2 Replies)
Discussion started by: rainbow_bean
2 Replies

10. Programming

Unix File has 000 access when written

Good day! I would just like to ask about an issue I encountered. There is a Java program (version1.3) that we use that is hosted in Unix (HP-UX B.11.11 U), and one of its functions copies a file and writes it to another directory. It usually runs fine, but one day, it wrote a file that had 000... (2 Replies)
Discussion started by: mike_s_6
2 Replies
cr(1)							      General Commands Manual							     cr(1)

NAME
cr - converts text files between nix EOL and dos EOL SYNOPSIS
cr - | + <input file> <output file> DESCRIPTION
Text files, such as tle files, that come from a dos source usualy have the ^M symbol at the end of every line. Cr converts files between the dos newline format and the normal *nix newline format by stripping the ^M to convert dos to *nix, using the '-' option, or adding ^M to a *nix file to create the proper dos file when the '+' option is used. Although this extra character is not often a problem, programs like seesat5, which are data driven will encounter parsing problems when the extra character is present. It is these problems that cr is intended to repair. Options - | + One or the other of these options is required. The '-' option is used to remove ^M from all newlines found in the dos file. The '+' option is used to add ^M to every newline found in a *nix file. input file Fully delineated path to the input file. As this program is used in the dos environment as well, standard input is not used. output file Fully delineated path to the output file. As this program is used in the dos environment as well, standart output is not used. SEE ALSO
seesat5(1), seesat5(7), SEESAT5.INI(5), tle(5) BUGS
Cr is not an inteligent program. It methodicaly replaces/removes the offending character when it finds it in the correct context. Newline sequences found in contexts other than 'newline' will be replaced/removed just like those found in the proper context. Passing a binary file through cr is not advised, for this reason. Send all inqueries to Dale Scheetz <dwarf@polaris.net>. Debian Linux 2 April 96 cr(1)
All times are GMT -4. The time now is 06:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy