- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- dos2unix path
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- 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.