LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 05-02-2006, 06:24 PM   #1
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Rep: Reputation: 15
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
 
Old 05-02-2006, 06:41 PM   #2
ataraxia
Member
 
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296

Rep: Reputation: 30
What do you want it to do? Not create any files, but just touch them if there are any? Use "-c" flag.
 
Old 05-02-2006, 07:35 PM   #3
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
Well it creates a file called

/*test

I would like it to create a file called:

*test

Sorry, I was a little vague.
 
Old 05-02-2006, 09:19 PM   #4
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
Any ideas at all? Anyone?
 
Old 05-02-2006, 09:54 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
On my machine (Ubuntu 5.10, bash) it works the way you were hoping. I cannot imagine where the "/" might be coming from.
 
Old 05-02-2006, 09:56 PM   #6
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
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.
 
Old 05-02-2006, 10:36 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,087

Rep: Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115
alias ???????
 
Old 05-03-2006, 01:30 AM   #8
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
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.
 
Old 05-03-2006, 02:16 AM   #9
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
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
 
Old 05-03-2006, 08:02 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,087

Rep: Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115Reputation: 4115
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.
 
Old 05-03-2006, 10:13 AM   #11
twistedpair
Member
 
Registered: Jan 2004
Posts: 71

Original Poster
Rep: Reputation: 15
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.
 
Old 05-03-2006, 11:33 AM   #12
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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 11:47 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch Question ddu_ Linux - Newbie 1 01-13-2006 12:24 AM
Touch pad tapping question pgte3 Linux - General 2 09-28-2004 10:10 AM
Error - can't touch touch: /var/lock - filesystem problem? xanas3712 Linux - Newbie 0 05-10-2004 06:26 AM
Help with the TOUCH utility t3___ Linux - Software 25 02-18-2004 02:26 PM
touch question rewt Linux - General 1 08-05-2001 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration