A Good Question.
am 31.03.2004 07:55:44 von scott.smallsreed
This is a multi-part message in MIME format.
------=_NextPart_000_001B_01C416A1.C0404640
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
1. How would you create a file named "--help"?
I actually created a the file by doing something like touch test >>--help.
But I think there is a "proper" way to create it?
2. How would you remove a file named "--help"?
Scott D. Smallsreed
3030 Chipmunk Dr.
Washoe Valley, NV 89704
775.849.8411 Hm
775.849.8412 Fax
775.722.7773 Cell
------=_NextPart_000_001B_01C416A1.C0404640
Content-Type: text/x-vcard;
name="Scott Smallsreed.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Scott Smallsreed.vcf"
BEGIN:VCARD
VERSION:2.1
N:Smallsreed;Scott
FN:Scott Smallsreed
TEL;HOME;VOICE:775-849-8411
TEL;HOME;FAX:775-849-8412
ADR;HOME:;;3030 Chipmunk Dr.;Washoe Valley;Nevada;89704;US
LABEL;HOME;ENCODING=3DQUOTED-PRINTABLE:3030 Chipmunk Dr.=3D0D=3D0AWashoe =
Valley, Nevada 89704=3D0D=3D0AUS
EMAIL;PREF;INTERNET:scott.smallsreed@mindspring.com
REV:20040331T055544Z
END:VCARD
------=_NextPart_000_001B_01C416A1.C0404640--
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A Good Question.
am 31.03.2004 08:28:28 von Jeff Woods
At 3/30/2004 09:55 PM -0800, Scott@Charter wrote:
>1. How would you create a file named "--help"?
>I actually created a the file by doing something like touch test >>--help.
>But I think there is a "proper" way to create it?
Commands that interpret --help as an option should (but might not) support
-- to indicate "end of options" and all arguments following are to be
interpreted as "non-option". Which means if the command takes a list of
files as arguments you can force it to recognize arguments beginning with -
as files by preceeding them with --. For example, the following
hypothetical command line:
$ somecommand --someoption --another -- --justafile --notanoption
--help
should treat --someoption and --another as options, but --justafile
--notanoption and --help should be treated as files (or whatever
somecommand wants to use those arguments for).
If touch tries to interpret --help as an option, then "touch -- --help"
should treat --help as a filename.
>2. How would you remove a file named "--help"?
Likewise, "rm -- --help" should remove filename --help
You could also use a partial or absolute path to the file, e.g.:
$ touch ./--help
or
$ touch $PWD/--help
If in doubt, sticking "./" in front of a filename in the current directory
can simplify ornery cases like this.
Bonus problems:
How to create and delete file names with spaces or control characters?
How about slashes (not as a directory delimiter) in the filename?
--
Jeff Woods
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A Good Question.
am 31.03.2004 08:33:05 von admins
touch ./--help
rm ./--help
Best regards,
Bostjan
On Wednesday 31 of March 2004 07:55, Scott@Charter wrote:
> 1. How would you create a file named "--help"?
> I actually created a the file by doing something like touch test >>--help.
> But I think there is a "proper" way to create it?
>
>
> 2. How would you remove a file named "--help"?
>
>
>
> Scott D. Smallsreed
> 3030 Chipmunk Dr.
> Washoe Valley, NV 89704
> 775.849.8411 Hm
> 775.849.8412 Fax
> 775.722.7773 Cell
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A Good Question.
am 31.03.2004 14:54:09 von Nico Schottelius
--ZInfyf7laFu/Kiw7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Jeff Woods [Tue, Mar 30, 2004 at 11:28:28PM -0700]:
> [...]=20
> Bonus problems:
> How to create and delete file names with spaces or control characters?
with spaces: rm "file with spaces" (quoted as one arg)
with control charaters: perpaps with their octal representation?
> How about slashes (not as a directory delimiter) in the filename?
slashes aren't iirc allowed in filenames on unix filesystems.
(and wouldn't make any sense either, as they are defined _as_ limiter,
you cannot escape them)
Nico
ps: I don't think any FAT/NTFS version can handle slashes either. But this =
is a guess.
--ZInfyf7laFu/Kiw7
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAar9xzGnTqo0OJ6QRArb8AJ94/aKi6DIYiEI6E2vwyY2QyE9sKgCe KnE7
ptjyccil+VikkbHBlEabFJg=
=rgAy
-----END PGP SIGNATURE-----
--ZInfyf7laFu/Kiw7--
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A Good Question.
am 31.03.2004 15:02:31 von Glynn Clements
Jeff Woods wrote:
> Bonus problems:
> How to create and delete file names with spaces or control characters?
Use single quotes; within single quotes, all characters are treated
literally, except for the terminating quote. If the filename contains
any single quotes, use '\'' (quote, backslash, quote, quote), e.g.
rm 'foo'\''bar'
will remove a file called foo'bar.
However, note that this issue is due to the shell; it doesn't apply
when passing arguments directly via e.g. execve(). OTOH, filenames
which look like options are due to the command itself.
> How about slashes (not as a directory delimiter) in the filename?
Not possible. A filename cannot contain a slash; this is enforced by
the kernel. If you encounter a filename which contains a slash, the
filesystem is corrupted.
--
Glynn Clements
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: A Good Question.
am 31.03.2004 22:32:09 von Bradley Hook
For spaces:
#touch my\ test
#touch 'my test'
#less my\ test
#less 'my test'
For backslashes:
#touch my\\test
#touch 'my\test'
#less my\\test
#less 'my\test'
Forward slashes aren't allowed by the kernel.
~Brad
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html