|
Prev: Cheap, Prada Chanel LV Women's Sandals, Dior Coach UGG Lady Sandals
Next: in-place editing in awk
From: Chad on 23 Jun 2008 23:57 I've had two software engineers tell me that ls;who and ls;'who' aren't the same thing. However, When I do ls;who, I get m-net% ls;who error hose hose.c infile outfile cdalten ttyp0 Jun 23 23:30 (66-81-67-103.bay) salini ttyp3 Jun 23 22:04 xnixan ttyp5 Jun 22 19:33 hunterfx ttyp7 May 11 13:56 (195.161.234.152) hobbhill ttyp8 Jun 23 23:45 (37.mercerville-4) marcvh ttypa Jun 17 20:40 (74.85.160.100) cdalten ttypb Jun 23 23:51 (66-81-67-103.bay) nfw ttype Jun 23 12:44 (gw16e.fmr.com) casper ttypf Mar 20 17:48 (207.150.165.110:) tod ttypj Jun 23 17:55 (foxxy.triohost.c) casper ttypq Mar 20 17:48 (207.150.165.110:) mickeyd ttypv Jun 20 18:52 (c-24-4-108-103.h) mk ttyq3 Jun 23 10:00 (78.52.228.174:S.) trex ttyq4 Jun 19 13:21 (198.108.48.82) mk ttyq6 Jun 23 10:01 (78.52.228.174:S.) Now, when I do ls;'who', I get the same output m-net% ls;'who' error hose hose.c infile outfile cdalten ttyp0 Jun 23 23:30 (66-81-67-103.bay) salini ttyp3 Jun 23 22:04 xnixan ttyp5 Jun 22 19:33 hunterfx ttyp7 May 11 13:56 (195.161.234.152) hobbhill ttyp8 Jun 23 23:45 (37.mercerville-4) marcvh ttypa Jun 17 20:40 (74.85.160.100) cdalten ttypb Jun 23 23:51 (66-81-67-103.bay) nfw ttype Jun 23 12:44 (gw16e.fmr.com) casper ttypf Mar 20 17:48 (207.150.165.110:) tod ttypj Jun 23 17:55 (foxxy.triohost.c) casper ttypq Mar 20 17:48 (207.150.165.110:) mickeyd ttypv Jun 20 18:52 (c-24-4-108-103.h) mk ttyq3 Jun 23 10:00 (78.52.228.174:S.) trex ttyq4 Jun 19 13:21 (198.108.48.82) mk ttyq6 Jun 23 10:01 (78.52.228.174:S.) m-net% What's the difference? I don't see it. Chad
From: pk on 24 Jun 2008 03:13 On Tuesday 24 June 2008 05:57, Chad wrote: > I've had two software engineers tell me that ls;who and ls;'who' > aren't the same thing. However, AFAICT, they are the same, since the shell will remove the single quotes around who and execute the two commands "ls" and "who" in sequence. -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome.
From: Bill Marcum on 24 Jun 2008 03:36 On 2008-06-24, Chad <cdalten(a)gmail.com> wrote: > > > I've had two software engineers tell me that ls;who and ls;'who' > aren't the same thing. However, > > When I do ls;who, I get > > m-net% ls;who > error hose hose.c infile outfile > cdalten ttyp0 Jun 23 23:30 (66-81-67-103.bay) > salini ttyp3 Jun 23 22:04 > xnixan ttyp5 Jun 22 19:33 > hunterfx ttyp7 May 11 13:56 (195.161.234.152) > hobbhill ttyp8 Jun 23 23:45 (37.mercerville-4) > marcvh ttypa Jun 17 20:40 (74.85.160.100) > cdalten ttypb Jun 23 23:51 (66-81-67-103.bay) > nfw ttype Jun 23 12:44 (gw16e.fmr.com) > casper ttypf Mar 20 17:48 (207.150.165.110:) > tod ttypj Jun 23 17:55 (foxxy.triohost.c) > casper ttypq Mar 20 17:48 (207.150.165.110:) > mickeyd ttypv Jun 20 18:52 (c-24-4-108-103.h) > mk ttyq3 Jun 23 10:00 (78.52.228.174:S.) > trex ttyq4 Jun 19 13:21 (198.108.48.82) > mk ttyq6 Jun 23 10:01 (78.52.228.174:S.) > > Now, when I do ls;'who', I get the same output > m-net% ls;'who' > error hose hose.c infile outfile > cdalten ttyp0 Jun 23 23:30 (66-81-67-103.bay) > salini ttyp3 Jun 23 22:04 > xnixan ttyp5 Jun 22 19:33 > hunterfx ttyp7 May 11 13:56 (195.161.234.152) > hobbhill ttyp8 Jun 23 23:45 (37.mercerville-4) > marcvh ttypa Jun 17 20:40 (74.85.160.100) > cdalten ttypb Jun 23 23:51 (66-81-67-103.bay) > nfw ttype Jun 23 12:44 (gw16e.fmr.com) > casper ttypf Mar 20 17:48 (207.150.165.110:) > tod ttypj Jun 23 17:55 (foxxy.triohost.c) > casper ttypq Mar 20 17:48 (207.150.165.110:) > mickeyd ttypv Jun 20 18:52 (c-24-4-108-103.h) > mk ttyq3 Jun 23 10:00 (78.52.228.174:S.) > trex ttyq4 Jun 19 13:21 (198.108.48.82) > mk ttyq6 Jun 23 10:01 (78.52.228.174:S.) > m-net% > > What's the difference? I don't see it. > No difference because 'who' doesn't contain any spaces, dollar signs or other special characters.
From: Barry Margolin on 24 Jun 2008 15:11 In article <g3q71q$hqh$1(a)aioe.org>, pk <pk(a)pk.invalid> wrote: > On Tuesday 24 June 2008 05:57, Chad wrote: > > > I've had two software engineers tell me that ls;who and ls;'who' > > aren't the same thing. However, > > AFAICT, they are the same, since the shell will remove the single quotes > around who and execute the two commands "ls" and "who" in sequence. I think there are two situations where quoting a command name makes a difference: 1) If it contains characters that are special to the shell, quoting prevents them from being treated specially. 2) If it's the name of an alias, the ordinary command will be executed rather than expanding the alias. Since "who" doesn't contain any special characters, "ls;who" and "ls;'who'" would only be different if you'd defined an alias named "who". -- Barry Margolin, barmar(a)alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***
From: pk on 24 Jun 2008 15:16 On Tuesday 24 June 2008 21:11, Barry Margolin wrote: >> > I've had two software engineers tell me that ls;who and ls;'who' >> > aren't the same thing. However, >> >> AFAICT, they are the same, since the shell will remove the single quotes >> around who and execute the two commands "ls" and "who" in sequence. > > I think there are two situations where quoting a command name makes a > difference: > > 1) If it contains characters that are special to the shell, quoting > prevents them from being treated specially. > > 2) If it's the name of an alias, the ordinary command will be executed > rather than expanding the alias. > > Since "who" doesn't contain any special characters, "ls;who" and > "ls;'who'" would only be different if you'd defined an alias named "who". Good points. However, none of these could be inferred from the OP's post. -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome.
|
Pages: 1 Prev: Cheap, Prada Chanel LV Women's Sandals, Dior Coach UGG Lady Sandals Next: in-place editing in awk |