- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- System Administration
- >
- dos2unix path
-
- Forums
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- OEM Solutions
- Servers: The Right Compute
- Shifting to Software-Defined
- Telecom IQ
- Transforming IT
- Infrastructure Solutions German
- L’Avenir de l’IT
- IT e Trasformazione Digitale
- Enterprise Topics
- ИТ для нового стиля бизнеса
- Blogs
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Forums
-
Blogs
-
InformationEnglish
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 01:30 PM
04-08-2008 01:30 PM
dos2unix path
dos2unix file
i have no problem, but if I use full path
dos2unix /dir/dir/file
it complains.
does anyone know if there is a workaround?
thank you
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 01:46 PM
04-08-2008 01:46 PM
Re: dos2unix path
>>
>>dos2unix /dir/dir/file
>>
>>it complains.
What does it complain about? Permissions? Can't find the file? What?
>>does anyone know if there is a workaround?
Not without knowing what it is complaining about.
Please provide any messages it is generating.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 01:49 PM
04-08-2008 01:49 PM
Re: dos2unix path
[yanga@prince src]$ dos2unix ui/test.txt
dos2unix: converting file ui/test.txt to UNIX format ...
[yanga@prince src]$ dos2unix /users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text
dos2unix: converting file /users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text to UNIX format ...
dos2unix: problems renaming '/users/misc/yanga/T124/BCVOB/TSG/src/ui/d2utmpe5Smg0 ' to '/users/misc/yanga/T124/BCVO
B/TSG/src/ui/test.text'
output file remains in '/users/misc/yanga/T124/BCVOB/TSG/src/ui/d2utmpe5Smg0 '
dos2unix: problems converting file /users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 01:55 PM
04-08-2008 01:55 PM
Re: dos2unix path
Anyway, the key appears to be:
[yanga@prince src]$ dos2unix /users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text
dos2unix: converting file /users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text to UNIX format ...
dos2unix: problems renaming '/users/misc/yanga/T124/BCVOB/TSG/src/ui/d2utmpe5Smg0 ' to '/users/misc/yanga/T124/BCVOB/TSG/src/ui/test.text'
If I am reading this correctly it is trying to overwrite the original file with the converted file. Correct? If so, you may not have the appropriate permission to do that.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 01:58 PM
04-08-2008 01:58 PM
Re: dos2unix path
I gave two examples there. If I convert it from the directory itself, it is fine. but, if I convert it from the parent directory, it has problem.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 02:12 PM
04-08-2008 02:12 PM
Re: dos2unix path
It should work similar, but the one you use appears to be simply broken. It suffers a buffer overflow problem. Unbelievable, and inexcusable, but the signs are there.
Complain to the provider of the program or switch over to HPUX.
If you do investigate further, then be sure to provide EXACT version information.
This is NOT a generic usage problem.
What Linux? Platform? where does the dos2unix come from.
Good luck!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 02:18 PM
04-08-2008 02:18 PM
Re: dos2unix path
You found it yourself...
(cd $target_direcory; dos2unix $target_file)
The problem was in renaming temporary output file back over the original.
If this was my problem would try with an artifically long directory in the path. See if that works.
# mkdir abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
# cp test/test.txt abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
# dos2unix abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/test.txt
fwiw,
Hein
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 02:20 PM
04-08-2008 02:20 PM
Re: dos2unix path
I was hoping that there is an easy workaround...well, it is easy enough..
thanks everyone.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 02:21 PM
04-08-2008 02:21 PM
Re: dos2unix path
> it is linux. but, dos2unix should work very similar right.
Well, "similar" != "same". That said, one workaround is to use Perl:
# perl -pe 's%\r\n%\n%; s%\032%% if eof' file
...to update inplace and preserve a copy of the old file as 'file.old':
# perl -pi.old -e 's%\r\n%\n%; s%\032%% if eof' file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 02:40 PM
04-08-2008 02:40 PM
Re: dos2unix path
IF it does not, then you should state UP FRONT that is an OS other than HP-UX.
Also, there is a LINUX forum that this should really have been posted in.
The dos2ux in HP-UX behaves differently that what you are seeing. The may do equivalent functions, but the do not work the exact same way. The kind of assumption you make could be dangerous with other commands.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2008 03:00 PM
04-08-2008 03:00 PM
Re: dos2unix path
appreciate!
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2019 Hewlett Packard Enterprise Development LP