This created $HOME/filename !?
date > $HOME///////filename
No common sense reason for this has occurred to me.
date > $HOME///////filename
No common sense reason for this has occurred to me.
It means that your programs can do things like:Quote:>This created $HOME/filename !?
>date > $HOME///////filename
>No common sense reason for this has occurred to me.
printf(Enter directory name: ");
gets(file_name);
strcat(file_name, "/basename");
Whereas in DOS you wind up doing:
printf(Enter directory name: ");
gets(file_name);
if (file_name[strlen(file_name) - 1] == '\\')
strcat(file_name, "basename");
else
strcat(file_name, "\\basename");
Actually it's worse since both slash and backslash are acceptable so you
really have to test for both.
If directory separators didn't collapse then what would "$HOME/////filename"
mean?
--
D'Arcy Cain Consulting | There's no government
Toronto, Ontario, Canada | like no government!
+1 416 424 2871 DoD#0082 |
Well, in the typical unix tradition, this has mutated intoQuote:>This created $HOME/filename !?
>date > $HOME///////filename
>No common sense reason for this has occurred to me.
However, most of the kernel's that I have seen all strip multiple '/' within
the middle of a pathname.
Several versions of "unix" treat leading double shashes "//foo" as a special
case. Examples of these are Domain OS (Apollo) and older versions of UTek
(Tektronix, rip)
-Jeff
--
James Risner
WHAT did you expect anyway? Anything else happening would make less senseQuote:>This created $HOME/filename !?
>date > $HOME///////filename
>No common sense reason for this has occurred to me.
Peter
This behavior is reasonable and desirable. On more than one
occasion, I've used a command such as
% mv f1 foo/bar/baz # baz is a directory, so file will be foo/bar/baz/f1
to move a file into a new directory without changing it's name.
Now, if I do this and misspell "baz", then instead of putting the
file in the directory foo/bar/baz, I end up with a file named
foo/bar/bax, or something like that. After doing this enough times,
I've gotten in the habbit of ALWAYS putting a slash at the end of
directory names in such cases.
% mv f1 foo/bar/baz/
Now if I misspell baz, the mv will fail, since the directory
foo/bar/bax doesn't exist. When I do spell baz correctly, mv almost
surely generates the target pathname internally as foo/bar/baz//f1,
so this trick of mine will only work if multiple slashes are treated
sensibly. This does NOT work under DOS...
% COPY F1.C SOURCE\
will barf. Stupid DOS.
Jim
--
USPS: NASA/Goddard SFC; Code 933; Greenbelt, MD 20771
Phone: +1 301 286-1131 Maryland Car Tags: DEV CAR
Motto: There is no 'd' in "kluge"! It rhymes with "huge", not "sludge"!
In Domain/OS and, I think, some other systems, "//foo/bar" was "fileQuote:>I am rather curious as to what special case "//foo" would signal?
> I am rather curious as to what special case "//foo" would signal?
cp *.c //r2d2/usr/local/src/foo.
to copy files from wherever you are to /usr/local/src/foo
on host, r2d2. You can also:
cd //r2d2/usr/users/foo
and
//c3p0/usr/local/bin/ispell foobar.
--
Dan Flak - Just another idiot, born in the USA and over 35.
1. execl( ..."/usr/bin/passwd", "username" ... ) ????
I want to create a process to execute passwd. I have the required
information: username, old_password, new_password, and have a pipe
created between the parent and child ready for the child (passwd)
to read (stdin) from the parent. What is the communuication protocol
with an interactive process like passwd? How are the responses from the
parent interleaved with passwd requests for old password, new password,
new password? How is this type of exchange implemented?
Purpose: For POPMail users on a wide area network to change their UNIX
passwords via a web page.
Thanks,
KFW u
--
sig schmig
2. steps for changing modules.conf .. quick question
3. more secure?: "#!/bin/sh -" or "#!/bin/sh"
4. Top 10 posters comp.unix.shell
5. "cd -L /usr/adm ; lc .." == "lc /var" ??
6. ftp server
8. Iomega Atapi Zip help for Newbie
9. GETSERVBYNAME()????????????????????"""""""""""""
10. Exec("/usr/bin/mailx -s \"fun bun\" mat.aida@cbs.dk)
11. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""
12. How to get "cd dir" working as "cd dir ; pwd"?
13. Type "(", ")" and "{", "}" in X...