The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to convert a partition usin 64 bits kernel to 32 bits kernel? GEIER AIX 2 2 Weeks Ago 12:20 AM
perm bits mpang_ Shell Programming and Scripting 1 02-10-2007 06:17 AM
AIX Bits and Pieces bakunin AIX 0 12-07-2005 06:20 AM
64 bits file qfwfq HP-UX 1 02-14-2005 12:35 PM
Changing 24 bits to 8 bits display larry UNIX for Dummies Questions & Answers 4 03-05-2002 07:51 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-27-2004
Registered User
 

Join Date: Aug 2004
Location: vernon-fr
Posts: 28
Question low-order seven bits

Hi and thx in advance

I have to transfert files between a UNIX server and a Network Appliance Filer and i have problem with accent characters on filename.

On unix side accent are interpreted as follow
ls -l unix* | cat -v
-rwxr--r-- 1 a067842 admDE 0 Sep 24 16:33 unix_M-^J.txt
and are well interpreted using samba (i.e. a windows workstation show the correct character).

If i transfert the file (using rsync with archive mode) on the filer and access it using NFS I see the same filename
ls -l unix* | cat -v
-rwxr--r-- 1 root other 0 Sep 24 16:38 unix_M-^J.txt

but It's not well interpreted by DOT (Data OnTap which is the Netapp filer Operating System) when accessed from a windows workstation (i.e. a windows workstation doesn't show the correct character)

If I create the file with the wanted filename from windows workstation on the filer it appears accessed from NFS like:
ls unix*.txt | cat -v
unix_M-i.txt

So I understand that M-i and M-^J shown by the cat -v command are differents , I will have to scan all my data and replace one character by the oher one to make the migration a success.
Problem how can I do this??? The cat man page indicates that characters starting with a "M-" string are non printable and correspond to the "low-order seven bits", is there a way to manipulate this ASCII characters using sed or something else?
Sorry for the long post, hope it's roughly clear (Huummhhh, not sure).
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-29-2004
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,502
You can employ tr to change control characters to something printable. Filenames with embedded control characters cause trouble.

try something like this to get rid of control characters.
Code:
for file in /path/*
do
        tmpfile=`basename "$file"`
        tmpfile=`echo "$tmpfile" | tr -s '[:cntrl:]'  'z' `
        mv "$file"  /path/"$tmpfile"
done
Reply With Quote
  #3 (permalink)  
Old 10-05-2004
Registered User
 

Join Date: Aug 2004
Location: vernon-fr
Posts: 28
the -b option of ls gives the octal value for non printable characters, using the tr command as indicated it's much more simple.
Thx.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0