Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-02-2006, 05:24 PM
|
#1
|
Member
Registered: Jan 2004
Posts: 71
Rep:
|
touch utility question
All,
When I issue the following comand:
touch *test
it gives me a file:
/*test
This is ridiculous. How do I turn that off?
Thanks!
Pair
|
|
|
05-02-2006, 05:41 PM
|
#2
|
Member
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296
Rep:
|
What do you want it to do? Not create any files, but just touch them if there are any? Use "-c" flag.
|
|
|
05-02-2006, 06:35 PM
|
#3
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
Well it creates a file called
/*test
I would like it to create a file called:
*test
Sorry, I was a little vague.
|
|
|
05-02-2006, 08:19 PM
|
#4
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
Any ideas at all? Anyone?
|
|
|
05-02-2006, 08:54 PM
|
#5
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
On my machine (Ubuntu 5.10, bash) it works the way you were hoping. I cannot imagine where the "/" might be coming from.
|
|
|
05-02-2006, 08:56 PM
|
#6
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
Exactly. On all my other machines it works the way it is supposed to. Unfortunately I don't exactly have the choice to re-install, or use another machine.
Other commands work the same way too. openssl for instance is affected too.
|
|
|
05-02-2006, 09:36 PM
|
#7
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,419
|
alias ???????
|
|
|
05-03-2006, 12:30 AM
|
#8
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
Would it help if I said that if I did this:
touch \*test
that I still get:
\*test
instead of the expected:
\\*test
Also,
mkdir *test
gives me:
\*test/
I kid you not.
|
|
|
05-03-2006, 01:16 AM
|
#9
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
Jeez, well hopefully it isn't going to matter. It seems that if I:
mkdir *test
and it creates:
\*test/
I can still rm -d *test
and it will work. I am hoping that even though it shows up as:
\*test
that I can still create manipulate and delete it by its given name of *test. In other words, despite having the \ character in front of it, I don't need to use the \ character to refer to it when performing any kind of adds deletes or changes. So I guess the problem is actually a non-problem? I HOPE so.
-Pair
|
|
|
05-03-2006, 07:02 AM
|
#10
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,419
|
I had a bit of a play this 'arvo.
Create a *test, and a \*test - separate files, I checked the inodes.
rm'd the *test - both files disappeared.
Did it all twice, just to be sure.
Merely more evidence - I offer no explanation.
|
|
|
05-03-2006, 09:13 AM
|
#11
|
Member
Registered: Jan 2004
Posts: 71
Original Poster
Rep:
|
I know that the "\" character is used as an escape character. Incidentally if you create a file:
touch @test
It does the same thing:
\@test
Oddness.
|
|
|
05-03-2006, 10:33 AM
|
#12
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
Does it give you a forwardslash (I think that that was a typo) or a backslash?
I guess that the last one makes sense. The backslash is the escape character indicating that the next character has to be taken literally (as you already mentioned). It will not be in the actual filename, but only in the representation in the shell.
'*' and '@' have special meanings, '*' as wildcard character and '@' for symbolic links (if I'm correct).
I suppose that there are a few more (question-mark and ...).
Code:
wim@btd-techweb01:~/test$ mkdir *test
wim@btd-techweb01:~/test$ ls -l
total 1
drwxr-xr-x 2 wim users 48 2006-05-03 17:48 \*test/
wim@btd-techweb01:~/test$ mkdir \test
wim@btd-techweb01:~/test$ ls -l
total 1
drwxr-xr-x 2 wim users 48 2006-05-03 17:48 \*test/
drwxr-xr-x 2 wim users 48 2006-05-03 17:49 test/
wim@btd-techweb01:~/test$ mkdir \\test
wim@btd-techweb01:~/test$ ls -l
total 2
drwxr-xr-x 2 wim users 48 2006-05-03 17:48 \*test/
drwxr-xr-x 2 wim users 48 2006-05-03 17:49 \\test/
drwxr-xr-x 2 wim users 48 2006-05-03 17:49 test/
wim@btd-techweb01:~/test$ rmdir *test
wim@btd-techweb01:~/test$ ls -l
total 0
wim@btd-techweb01:~/test$
Please note the command rmdir *test. It removes all 'test' directories as the '*' is the wildcard. Doing the same, but adding a backslash before the asterisk only deletes the intended directory.
PS using slackware 10.1
Last edited by Wim Sturkenboom; 05-03-2006 at 10:47 AM.
|
|
|
All times are GMT -5. The time now is 10:05 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|