Script to convert dos to UNIX in Solaris


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Script to convert dos to UNIX in Solaris
# 1  
Old 07-19-2019
Script to convert dos to UNIX in Solaris

Hi Team,

I am trying to implement a script in Solaris, that required to find the list of files inside directories and convert those to dos2unix conversion,

Can someone please help here..

Below is the example of scenario.
Code:
var1/tmp/pkg/tts-conf/4.16.0/tts-dev1-conf/root/app/weblogic/Oracle/Middleware/domains/dev1/DomainSetenv.sh
var1/tmp/pkg/tts-conf/4.16.0/tts-dev1-conf/root/app/weblogic/setenv.sh
var1/tmp/pkg/tts-conf/4.16.0/ttss-dev1-conf/root/app/weblogic/scripts/abc
var1/tmp/pkg/tts-conf/4.16.0/tts-dev1-conf/root/app/weblogic/scripts/xyz

now I want to convert all these to dos format using
Code:
dos2unix file file 2</dev/null

Thanks

Last edited by vbe; 07-19-2019 at 01:58 AM..
# 2  
Old 07-19-2019
Keeping in mind that
Quote:
-o --oldfile file ...

Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used.
, why not try
Code:
dos2unix *

?
Your stderr redirection seems a bit weird.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert UNIX rights in a number in a sh script

Hello, i'm trying to write a script sh to convert the rights of a folder or file in a number. Explain: ls -l = rwxrwxrwx so i must display 777. Do you known where i can find so convert script Thanks Use code tags, thanks. (11 Replies)
Discussion started by: steiner
11 Replies

2. Shell Programming and Scripting

UNIX or Perl script to convert JSON to CSV

Is there a Unix or Perl script that converts JSON files to CSV or tab delimited format? We are running AIX 6.1. Thanks in advance! (1 Reply)
Discussion started by: warpmail
1 Replies

3. Shell Programming and Scripting

Convert for command from DOS to SHELL

Well, this command has served me quite well under DOS for %%X in (*.txt) do COMMAND however in linux it just outputs: "./install.sh line 1: '%%x': not a valid identifier. Ideas ? Thanks in advance (2 Replies)
Discussion started by: pasc
2 Replies

4. Shell Programming and Scripting

Convert unix script in to php

Hi All, I have one shell script and like to convert into GUI for user creation..Any way to convert shell script into php? Please find the below for my script. $ more user.sh #!/bin/ksh set -x pwfile="/etc/passwd" shadowfile="/etc/shadow" gfile="/etc/group" ######Want to check... (0 Replies)
Discussion started by: susindram
0 Replies

5. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

6. Shell Programming and Scripting

convert script linux to solaris???

dear all how to convert my script like this Code: awk -F "," '{close(f);f=$1}{print > f".txt"}' sample.txt for using in solaris iam first in solaris so all my script in linux not alot of working in solaris thx for advice (2 Replies)
Discussion started by: zvtral
2 Replies

7. Shell Programming and Scripting

convert unix script to perl

Hi, I have these lines in a unix script: FILEONE = /<filepath1>/<filename1.txt> FILENEW = /<filepath2>/<filename2.txt> head -5 $FILEONE | sed '1d' > $FILENEW PARAM1 = `cat $FILENEW | awk '{print $2;}' ` echo "Param1 Value: $PARAM1" What's the correct syntax of the above lines if same... (2 Replies)
Discussion started by: gholdbhurg
2 Replies

8. Shell Programming and Scripting

Execute a UNIX script from DOS prompt.

Hello, I m trying to execute a UNIX task from windows, I am copying few csv files from UNIX platform to my windows using a bat file like the txt file is as follows : open 172.21.13.239 root root lcd C:\Documents and Settings\aparna_sharma\Desktop\Trunk_Analysis cd /opt/Trunk_Analysis/... (24 Replies)
Discussion started by: er_aparna
24 Replies

9. Shell Programming and Scripting

how to convert unix .ksh script to windows .batch script

I am using awk in my .ksh script but when I am trying to run in windows its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like. thanx. #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)
Discussion started by: 2.5lt V8
1 Replies

10. UNIX for Dummies Questions & Answers

Can Unix (Solaris) execute a dos .bat script?

I did a search and found lots of questions/comments about how a dos script could execute Unix but not the other way round. If it's possible, I'd like the link to a post/site that would show me the way. Thanks. (4 Replies)
Discussion started by: BCarlson
4 Replies
Login or Register to Ask a Question