different file names under different shells

different file names under different shells

Post by Lei Min » Tue, 24 Nov 1998 04:00:00



hi

    I have two questions. The first one is whether it is possible for a
file
to have different names under bash and csh. In my department's system, I
came across a strange thing that a folder is called "\r" under bash and
"?'
under csh. It seemed that "?" is the right name. Under csh, I can "cd"
into
"?". But under bash, I can't "cd" into "\r".

    The second one is that in shell script "startx", there is a line
including a expression "/''*". I am wondering whether "\*" is enough.
What
is the use of two single quotes in the "\''*".

    Any help will be much appreciated.

Lei

 
 
 

different file names under different shells

Post by Jim Nicholso » Tue, 24 Nov 1998 04:00:00


Quote:>>>>> "Lei" == Lei Ming <Lei> writes:

Lei> hi I have two questions. The first one is whether it is possible
Lei> for a file to have different names under bash and csh. In my
Lei> department's system, I came across a strange thing that a folder
Lei> is called "\r" under bash and "?'  under csh. It seemed that "?"
Lei> is the right name. Under csh, I can "cd" into "?". But under
Lei> bash, I can't "cd" into "\r".

There can be multiple directory entries for a file (i.e. a file can
appear in several different directories or even the same directory
with different names) but this is not one of those cases.

What you have here is a filename containing a non-printing character
(carriage-return or decimal 13).  it sounds like you have different
options for ls under csh and bash.  The reason why you can cd into "?"
is that "?" is a metacharacter which csh interprets as "any
character", i.e. cd to "the directory whose name is a single
character".  The reason why you can't cd to "\r" is because bash
doesn't recognise "r" as a special character which you are trying to
escape and so has just stripped off the "\" and tried to change to
directory "r" which doesn't exist.

Lei>     The second one is that in shell script "startx", there is a
Lei> line including a expression "/''*". I am wondering whether "\*"
                                  ^
Lei> is enough.  What is the use of two single quotes in the "\''*".
                                                              ^
The "\" means don't treat the next character as special treat it as
literal text.  If you could include the whole line, I could tell you
what was going on.

Lei>     Any help will be much appreciated.

Lei> Lei

--
I am Dyslexic of Borg. Prepare to have your arse laminated.

 
 
 

1. Is it possible for a file has different names under different shells

hi

    I have two questions. The first one is whether it is possible for a file
to have different names under bash and csh. In my department's system, I
came across a strange thing that a folder is called "\r" under bash and "?'
under csh. It seemed that "?" is the right name. Under csh, I can "cd" into
"?". But under bash, I can't "cd" into "\r".

    The second one is that in shell script "startx", there is a line
including a expression "/''*". I am wondering whether "\*" is enough. What
is the use of two single quotes in the "\''*".

    Any help will be much appreciated.

Lei

2. DHCP?

3. Different Functions of Same Name in Different Libs

4. CDROM Audio Cable for 7248

5. Using different IP Names for different Unix apps.

6. Help with SCSI and Video

7. Resolving different domain names to different pages?

8. Where is XFconfig?!

9. file names under different shells

10. search and delete different files in different directories

11. jfs, vxfs, different file system , different ways of increasing

12. Makefiles involving files in different directories requiring different compilers