- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Is there a dos2unix command in HP?
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
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
тАО03-07-2000 10:49 PM
тАО03-07-2000 10:49 PM
Is there a dos2unix command in HP?
removing the ^M's in the file - similiar to the dos2unix command in sun.
If anyone knows of such a command in HP, please let me know. I really
appreciate it.
Thanks,
Connie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2000 12:18 AM
тАО03-08-2000 12:18 AM
Re: Is there a dos2unix command in HP?
sed 's/^M//' infile > outfile
"^M" is generated by (ctrl-v, ctrl-m)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2000 12:29 AM
тАО03-08-2000 12:29 AM
Re: Is there a dos2unix command in HP?
#!/usr/bin/sh
PATH=/usr/bin; p0=${0##*/}
v=; [[ "$1" = -v ]] && { v=.; shift;}
[[ $#.$p0 != 1.d2u && $#.$p0 != 1.u2d ]] &&
{ cat <<-. >&2
End-of-line style direct file converter - using ed (DOS<->UX formats)
Usage: d2u [-v] {file} to convert DOS->UX (CR+LF->LF)
u2d [-v] {file} to convert UX->DOS (LF->CR+LF)
-v for verbose output (echoes # of lines)
.
exit 2;}
[[ ! -f $1 || ! -r $1 || ! -w $1 ]] &&
{ cat <<-. >&2
$p0 -- $1 not regular+readable+writable:
$(ls -ld $1 2>&1)
.
exit 1;}
a=$(grep -c "^M$" $1); l=$(wc -l <$1)
[[ $l = 0 ]] && { [[ -n $v ]] && echo "$p0 -- $1: no lines"; exit 0;}
if [[ $p0 = u2d ]] ; then
if [[ $a != 0 ]] ; then
x=already; [[ $a != $l ]] && x=partially
echo "$p0 -- $1 $x in DOS-format">&2; exit 1
fi
s=DOS; echo "1,\$s/\$/^M/\nw\nq"|ed -s $1; e=$?
else # [[ $p0 = d2u ]]
[[ $a = 0 ]] && { echo "$p0 -- $1 already in UX-format">&2; exit 1;}
s=UX; echo "1,\$s/^M\$//\nw\nq"|ed -s $1; e=$?
fi
[[ $e = 0 && -n $v ]] &&
{ v=s; [[ $l = 1 ]] && v=; echo "$p0 -- $1: $l line$v ($s-format)";}
exit $e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2000 01:10 AM
тАО03-08-2000 01:10 AM
Re: Is there a dos2unix command in HP?
I believe the command you're looking for is /usr/bin/dos2ux.
Regards,
Claire Ruben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2000 04:23 AM
тАО03-08-2000 04:23 AM
Re: Is there a dos2unix command in HP?
swlist -l product | grep DOS
you should see the following if you have the MSDOS utilities installed::
MSDOS-Utils B.10.20 MSDOS-Utils
If so, then there are various dos commands that will help you, including the
dos2ux command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2000 08:32 PM
тАО03-09-2000 08:32 PM
Re: Is there a dos2unix command in HP?
transfer your text files as binary then there are no ^M in the file anyway