tcsh files with special characters

tcsh files with special characters

Post by Pickle » Thu, 28 Mar 2002 11:39:11



Hi.  I'm having trouble deleting (or doing anything with) files with
special characters in the name.

I am using tcsh on a Mac OS 10.1 computer.

When I hit Control-D, I get a list including the file I'm trying to
delete.  However, neither ls of the directory, wildcard completion, or
trying to escape the characters helps.

Output from Sc<ctrl-d>:
Sch\355\265\261\355\277\211st.txt

Output from 'ls .':
ls: Sch??st.txt: No such file or directory

Output from 'ls Sc*':
ls: No match.

Any idea how to delete files with the above names?

 
 
 

tcsh files with special characters

Post by laura fairhe » Thu, 28 Mar 2002 23:54:09



>Hi.  I'm having trouble deleting (or doing anything with) files with
>special characters in the name.

>I am using tcsh on a Mac OS 10.1 computer.

>When I hit Control-D, I get a list including the file I'm trying to
>delete.  However, neither ls of the directory, wildcard completion, or
>trying to escape the characters helps.

>Output from Sc<ctrl-d>:
>Sch\355\265\261\355\277\211st.txt

>Output from 'ls .':
>ls: Sch??st.txt: No such file or directory

>Output from 'ls Sc*':
>ls: No match.

The wild-card should expand.

Either the OS is broken, or your filesystem is corrupted.

To test the former you could try making a temporary
directory and put a file with a similar name in there;

$ mkdir test
$ cd test
$ : >`echo 'TEST_abcade' |tr 'abcde' '\355\265\261\277\211'`
$ ls TEST_*

To test the later you can run some of the file system
diagnostics on your drive and check everything is okay.

It seems to me that they've added a 16-bit character
thing to the OS, that is indicated by the \355 character.
You might want to skim through the shell man page and
have a look at the file pattern expansion sections;
for example there may be an option that enables '*'/'?'/...
to expand these special 16-bit characters. Otherwise there
might at least be some information about it...

Quote:

>Any idea how to delete files with the above names?

I would find out how to delete them and then make sure
you stop whatever put them on there from putting them
on there again.

Can you delete them from the GUI?

If the file I suggested you created above shows the
exact same behaviour as the ones you are trying to
delete, one thing you could try next is;

$ cd ..           # get out of the 'test' directory
$ rm -r test      # try to delete it

If that workz, a way to fix your problem is to
simply move all good files out of the directory
leaving only the odd ones you want to delete, then
you can 'rm -r' the whole directory to kill them.

regards

--

                # if you are bored crack my sig.
1F8B0808CABB793C0000666667002D8E410E83300C04EF91F2877D00CA138A7A
EAA98F30C494480157B623C4EF1B508FDED1CEFA9152A23DE35D661593C5318E
630C313CD701BE92E390563326EE17A3CA818F5266E4C2461547F1F5267659CA
8EE2092F76C329ED02CA430C5373CC62FF94BAC6210B36D9F9BC4AB53378D978
80F2978A1A6E5D6F5133B67B6113178DC1059526698AFE5C17A5187E7D930492

 
 
 

tcsh files with special characters

Post by Doug Mill » Fri, 29 Mar 2002 01:24:17




>>Hi.  I'm having trouble deleting (or doing anything with) files with
>>special characters in the name.

>>I am using tcsh on a Mac OS 10.1 computer.

>>When I hit Control-D, I get a list including the file I'm trying to
>>delete.  However, neither ls of the directory, wildcard completion, or
>>trying to escape the characters helps.

>>Output from Sc<ctrl-d>:
>>Sch\355\265\261\355\277\211st.txt
[snip]

>It seems to me that they've added a 16-bit character
>thing to the OS, that is indicated by the \355 character.

Correct me if I'm wrong, but isn't that an *octal* number?
355 octal = 11101101 binary, still just 8 bits.

--
Real email address is alphageek /at/ milmac /dot/ com

.. Ted Kennedy's car has killed more people than my gun.

 
 
 

tcsh files with special characters

Post by laura fairhe » Fri, 29 Mar 2002 01:34:56




>>Hi.  I'm having trouble deleting (or doing anything with) files with
>>special characters in the name.

>>I am using tcsh on a Mac OS 10.1 computer.

>>When I hit Control-D, I get a list including the file I'm trying to
>>delete.  However, neither ls of the directory, wildcard completion, or
>>trying to escape the characters helps.

>>Output from Sc<ctrl-d>:
>>Sch\355\265\261\355\277\211st.txt

>>Output from 'ls .':
>>ls: Sch??st.txt: No such file or directory

>>Output from 'ls Sc*':
>>ls: No match.

>The wild-card should expand.

>Either the OS is broken, or your filesystem is corrupted.

>To test the former you could try making a temporary
>directory and put a file with a similar name in there;

>$ mkdir test
>$ cd test
>$ : >`echo 'TEST_abcade' |tr 'abcde' '\355\265\261\277\211'`
>$ ls TEST_*

>To test the later you can run some of the file system
>diagnostics on your drive and check everything is okay.

>It seems to me that they've added a 16-bit character
>thing to the OS, that is indicated by the \355 character.
>You might want to skim through the shell man page and
>have a look at the file pattern expansion sections;
>for example there may be an option that enables '*'/'?'/...
>to expand these special 16-bit characters. Otherwise there
>might at least be some information about it...

>>Any idea how to delete files with the above names?

>I would find out how to delete them and then make sure
>you stop whatever put them on there from putting them
>on there again.

>Can you delete them from the GUI?

>If the file I suggested you created above shows the
>exact same behaviour as the ones you are trying to
>delete, one thing you could try next is;

>$ cd ..           # get out of the 'test' directory
>$ rm -r test      # try to delete it

>If that workz, a way to fix your problem is to
>simply move all good files out of the directory
>leaving only the odd ones you want to delete, then
>you can 'rm -r' the whole directory to kill them.

>regards

Another possibility is stating the full file name
in the delete command;

$ rm `awk 'BEGIN{printf "Sch\355\265\261\355\277\211st.txt";exit}'`

or

$ rm `echo Sch123456st.txt |tr '123456' '\355\265\261\355\277\211'`

If there are a small number of these files this might be okay
[ if you can delete them of course ]

For a large number maybe you could capture the output of CTRL+D somehow
[ 'script' command ] then process that file to produce a script that will
remove the files.

Although if 'ls .' complains the problems might be too deep for this,
but it maybe good for you if it workz and you have a small number of
these files and a large number of good files [ I don't have this
context information unfortunately ] otherwise 'rm -r' and don't
get those files on there again !

bestwishes

--

                # if you are bored crack my sig.
1F8B0808CABB793C0000666667002D8E410E83300C04EF91F2877D00CA138A7A
EAA98F30C494480157B623C4EF1B508FDED1CEFA9152A23DE35D661593C5318E
630C313CD701BE92E390563326EE17A3CA818F5266E4C2461547F1F5267659CA
8EE2092F76C329ED02CA430C5373CC62FF94BAC6210B36D9F9BC4AB53378D978
80F2978A1A6E5D6F5133B67B6113178DC1059526698AFE5C17A5187E7D930492

 
 
 

tcsh files with special characters

Post by laura fairhe » Fri, 29 Mar 2002 01:47:12





>>>Hi.  I'm having trouble deleting (or doing anything with) files with
>>>special characters in the name.

>>>I am using tcsh on a Mac OS 10.1 computer.

>>>When I hit Control-D, I get a list including the file I'm trying to
>>>delete.  However, neither ls of the directory, wildcard completion, or
>>>trying to escape the characters helps.

>>>Output from Sc<ctrl-d>:
>>>Sch\355\265\261\355\277\211st.txt
>[snip]

>>It seems to me that they've added a 16-bit character
>>thing to the OS, that is indicated by the \355 character.

>Correct me if I'm wrong, but isn't that an *octal* number?
>355 octal = 11101101 binary, still just 8 bits.

No, you're not wrong, \355 is an octal number and all
the values are 8-bits however in the output given for 'ls .'
only TWO '?' characters are displayed.

Output from Sc<ctrl-d>:
Sch\355\265\261\355\277\211st.txt

Output from 'ls .':
ls: Sch??st.txt: No such file or directory

Although I do not know for sure [ I don't have documentation to
hand on Mac OS ], this would indicate to me that \355 is being used
as a special meta-code to signify that the 2 bytes following
are a 16-bit character-->

\355,\265,\261 = 16-bit char{265,261}
\355,\277,\211 = 16-bit char{277,211}

The discrepancy with the 'ls' output would be explained by this
[ the 2 "?" characters being those 2 16-bit characters ]
and the pattern is consistent.

Quote:>--
>Real email address is alphageek /at/ milmac /dot/ com

>.. Ted Kennedy's car has killed more people than my gun.

bestwishes

--

                # if you are bored crack my sig.
1F8B0808CABB793C0000666667002D8E410E83300C04EF91F2877D00CA138A7A
EAA98F30C494480157B623C4EF1B508FDED1CEFA9152A23DE35D661593C5318E
630C313CD701BE92E390563326EE17A3CA818F5266E4C2461547F1F5267659CA
8EE2092F76C329ED02CA430C5373CC62FF94BAC6210B36D9F9BC4AB53378D978
80F2978A1A6E5D6F5133B67B6113178DC1059526698AFE5C17A5187E7D930492

 
 
 

tcsh files with special characters

Post by Sven Maschec » Fri, 29 Mar 2002 03:44:02



> I'm having trouble deleting (or doing anything with) files with
> special characters in the name. [Mac OS 10.1]
> [tcsh]  Output from Sc<ctrl-d>:
> Sch\355\265\261\355\277\211st.txt
> Output from 'ls .':
> ls: Sch??st.txt: No such file or directory

I don't know MacOS, so as a wild guess: try to fix your locale
and tty settings, <http://www.uni-ulm.de/~s_smasch/locale/>.

Sven

 
 
 

tcsh files with special characters

Post by Pickle » Fri, 29 Mar 2002 18:56:26


Phew.... no luck still....



> >Either the OS is broken, or your filesystem is corrupted.

> >To test the former you could try making a temporary
> >directory and put a file with a similar name in there;

> >$ mkdir test
> >$ cd test
> >$ : >`echo 'TEST_abcade' |tr 'abcde' '\355\265\261\277\211'`
> >$ ls TEST_*

The test file is created and is easily deleteable, but it appears that
the characters are only 8-bit:

$ ls
TEST_??????

Quote:> >To test the later you can run some of the file system
> >diagnostics on your drive and check everything is okay.

Seems fine, according to both fsck and Disk First Aid

Quote:> >I would find out how to delete them and then make sure
> >you stop whatever put them on there from putting them
> >on there again.

Heh.  Part 2 of that's already taken care of.  I scp'd them from a
Windows box.  It was complaining that the filename was too long, so I
kept cutting it shorter until the accents were removed.

Quote:> >Can you delete them from the GUI?

No.  In fact, it breaks the window (only shows a partial listing)

Quote:> >If that workz, a way to fix your problem is to
> >simply move all good files out of the directory
> >leaving only the odd ones you want to delete, then
> >you can 'rm -r' the whole directory to kill them.

I wish...  rm -r doesn't work, nor does -rf, whether as myself or root.

Quote:> Another possibility is stating the full file name
> in the delete command;

> $ rm `awk 'BEGIN{printf "Sch\355\265\261\355\277\211st.txt";exit}'`

> or

> $ rm `echo Sch123456st.txt |tr '123456' '\355\265\261\355\277\211'`

nope.

I also tried a c program that tried to unlink the files directly,
without trying to stat them.  No luck there either.

I may try a mac-specific group... I'll let y'all know if I make any
progress (short of reformatting that partition)...