The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 08-18-2008 03:20 AM
perm bits mpang_ Shell Programming and Scripting 1 02-10-2007 10:17 AM
AIX Bits and Pieces bakunin AIX 0 12-07-2005 10:20 AM
64 bits file qfwfq HP-UX 1 02-14-2005 04:35 PM
Changing 24 bits to 8 bits display larry UNIX for Dummies Questions & Answers 4 03-05-2002 11:51 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-27-2004
solea solea is offline
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).
  #2 (permalink)  
Old 09-29-2004
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,730
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
  #3 (permalink)  
Old 10-06-2004
solea solea is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0