* Problem with DOS files tranfered to UNIX
@ 1997-04-13 4:00 Kaj Stengade Christensen
1997-04-17 4:00 ` Shripad Lale
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kaj Stengade Christensen @ 1997-04-13 4:00 UTC (permalink / raw)
Hi
I am having 2 problems with files that is tranfered from a DOS system to
my UNIX system.
1. When i tranfer DOS text files to UNIX there is a ^M in the end of all
lines (carige return). I was wondering is there is a utility that can
remove this from the file and where i can get the utility.
2. I am using CuteFTP to tranfer files from DOS to UNIX and when i do
this alle the files in is uppercase, and i need them in lowercase. Is
there a utility in OSF/1 to convert the filenames or where can i get a
program / script that can do this.
I am using an Alpha 2100 running OSF/1 ver. 3.2C
Any help will be appreciated.
Thanks
Kaj Stengade Christensen
System administrator Nukissiorfiit Greenland.
kc@greennet.gl
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with DOS files tranfered to UNIX
1997-04-13 4:00 Problem with DOS files tranfered to UNIX Kaj Stengade Christensen
1997-04-17 4:00 ` Shripad Lale
@ 1997-04-17 4:00 ` Alan Hughes
1997-04-17 4:00 ` Hans Schwengeler, Astronomical Institute, Tel. 2055422
2 siblings, 0 replies; 5+ messages in thread
From: Alan Hughes @ 1997-04-17 4:00 UTC (permalink / raw)
Kaj Stengade Christensen wrote:
>
> Hi
>
> I am having 2 problems with files that is tranfered from a DOS system to
> my UNIX system.
>
> 1. When i tranfer DOS text files to UNIX there is a ^M in the end of all
> lines (carige return). I was wondering is there is a utility that can
> remove this from the file and where i can get the utility.
Before you transfer your files, set your FTP system into ASCII mode (use
the ascii sub-command); DOS uses CRLF sequences to indicate an end-of-
line, while UNIX uses CR, FTP will convert if set into this mode.
> 2. I am using CuteFTP to tranfer files from DOS to UNIX and when i do
> this alle the files in is uppercase, and i need them in lowercase. Is
> there a utility in OSF/1 to convert the filenames or where can i get a
> program / script that can do this.
>
Anyone else know? The problem is that all DOS filenames are stored in
uppercase (converted by DOS when it creates the file), so FTP is doing
the correct thing here.
> I am using an Alpha 2100 running OSF/1 ver. 3.2C
>
> Any help will be appreciated.
>
> Thanks
> Kaj Stengade Christensen
> System administrator Nukissiorfiit Greenland.
> kc@greennet.gl
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with DOS files tranfered to UNIX
1997-04-13 4:00 Problem with DOS files tranfered to UNIX Kaj Stengade Christensen
1997-04-17 4:00 ` Shripad Lale
1997-04-17 4:00 ` Alan Hughes
@ 1997-04-17 4:00 ` Hans Schwengeler, Astronomical Institute, Tel. 2055422
2 siblings, 0 replies; 5+ messages in thread
From: Hans Schwengeler, Astronomical Institute, Tel. 2055422 @ 1997-04-17 4:00 UTC (permalink / raw)
In article <33512C65.7450@greennet.gl>, Kaj Stengade Christensen <kajsc@greennet.gl> writes:
> Hi
>
> I am having 2 problems with files that is tranfered from a DOS system to
> my UNIX system.
>
> 1. When i tranfer DOS text files to UNIX there is a ^M in the end of all
> lines (carige return). I was wondering is there is a utility that can
> remove this from the file and where i can get the utility.
>
> 2. I am using CuteFTP to tranfer files from DOS to UNIX and when i do
> this alle the files in is uppercase, and i need them in lowercase. Is
> there a utility in OSF/1 to convert the filenames or where can i get a
> program / script that can do this.
>
> I am using an Alpha 2100 running OSF/1 ver. 3.2C
>
> Any help will be appreciated.
>
> Thanks
> Kaj Stengade Christensen
> System administrator Nukissiorfiit Greenland.
> kc@greennet.gl
>
Dear Kaj,
I found a script for removing CR's on the net, maybe it works for you:
#! /bin/ksh
# convert dos files to Unix by removing carriage returns.
for f in $@
do
tr -d '\015' <$f >${f}+ && mv -i $f ${f}~ && mv -i ${f}+ $f
done
Yours, Hans.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with DOS files tranfered to UNIX
1997-04-13 4:00 Problem with DOS files tranfered to UNIX Kaj Stengade Christensen
@ 1997-04-17 4:00 ` Shripad Lale
1997-04-20 4:00 ` Bob Harris
1997-04-17 4:00 ` Alan Hughes
1997-04-17 4:00 ` Hans Schwengeler, Astronomical Institute, Tel. 2055422
2 siblings, 1 reply; 5+ messages in thread
From: Shripad Lale @ 1997-04-17 4:00 UTC (permalink / raw)
Kaj Stengade Christensen (kajsc@greennet.gl) wrote:
: I am having 2 problems with files that is tranfered from a DOS system to
: my UNIX system.
...<snip>...
: 2. I am using CuteFTP to tranfer files from DOS to UNIX and when i do
: this alle the files in is uppercase, and i need them in lowercase. Is
: there a utility in OSF/1 to convert the filenames or where can i get a
: program / script that can do this.
Put the following one line script in your path in a file (say), 'lcase':
mv $1 `echo $1 | awk '{print tolower($0)}'`
Then use :
lcase <filename>
to convert the filename to lowercase.
One question to you wizards out there. Actually, this command is small
enough to warrent being an alias. But the single quote (') character
required in the awk command makes it very difficult. Any idea how you
could make lcase into an alias instead of an one line executable file?
--
+--------------------------------+------------------------------+
| Shripad Lale | |
| Tata Consultancy Services,Pune | Tel(O) : (407)-242-4204 |
| c/o General Electric-Harris | Tel(R) : (407)-956-2547 |
| 407, John Rodes Blvd, | email : slale@ge-harris.com |
| Melbourne, FL 32901, USA | |
+--------------------------------+------------------------------+
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem with DOS files tranfered to UNIX
1997-04-17 4:00 ` Shripad Lale
@ 1997-04-20 4:00 ` Bob Harris
0 siblings, 0 replies; 5+ messages in thread
From: Bob Harris @ 1997-04-20 4:00 UTC (permalink / raw)
In article <5j5gs9$a31$1@Commuter.ge-harris.com>, slale@ge-harris.com
(Shripad Lale) wrote:
>
> Put the following one line script in your path in a file (say), 'lcase':
>
> mv $1 `echo $1 | awk '{print tolower($0)}'`
>
> Then use :
>
> lcase <filename>
>
> to convert the filename to lowercase.
>
> One question to you wizards out there. Actually, this command is small
> enough to warrent being an alias. But the single quote (') character
> required in the awk command makes it very difficult. Any idea how you
> could make lcase into an alias instead of an one line executable file?
So try a different approach
alias lcase 'echo $1 | tr "[A-Z]" "a-z"'
That should do the same thing.
--
Bob Harris
I don't get to tell me what to do, I only get to tell me how to do it.
The opinions expressed are my own and do not represent Digital Equipment
Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1997-04-20 4:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-04-13 4:00 Problem with DOS files tranfered to UNIX Kaj Stengade Christensen
1997-04-17 4:00 ` Shripad Lale
1997-04-20 4:00 ` Bob Harris
1997-04-17 4:00 ` Alan Hughes
1997-04-17 4:00 ` Hans Schwengeler, Astronomical Institute, Tel. 2055422
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox