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 |
What do you want it to do? Not create any files, but just touch them if there are any? Use "-c" flag.
|
Well it creates a file called
/*test I would like it to create a file called: *test Sorry, I was a little vague. |
Any ideas at all? Anyone?
|
On my machine (Ubuntu 5.10, bash) it works the way you were hoping. I cannot imagine where the "/" might be coming from.
|
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. |
alias ???????
|
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. |
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 |
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. |
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. |
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 PS using slackware 10.1 |
All times are GMT -5. The time now is 11:23 AM. |