November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | Steven Schveighoffer Wrote:
> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
>
> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
>
> I've since adopted the habit of calling test programs "testme" instead of "test" :)
Huh, must port windows console to linux ^_^
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Tuesday, November 01, 2011 04:27 Kagamin wrote:
> Steven Schveighoffer Wrote:
> > Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
> >
> > Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
> >
> > I've since adopted the habit of calling test programs "testme" instead of "test" :)
>
> Huh, must port windows console to linux ^_^
No. No. We must port Windows users to Linux. ;)
- Jonathan M Davis
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin Attachments:
| Ew. speak no blasphemy...
On Tue, Nov 1, 2011 at 6:27 AM, Kagamin <spam@here.lot> wrote:
> Steven Schveighoffer Wrote:
>
> > Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it
> anymore.
> >
> > Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
> >
> > I've since adopted the habit of calling test programs "testme" instead of "test" :)
>
> Huh, must port windows console to linux ^_^
>
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
> Steven Schveighoffer Wrote:
>
>> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
>>
>> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
>>
>> I've since adopted the habit of calling test programs "testme" instead of "test" :)
>
> Huh, must port windows console to linux ^_^
Too much work! Just put
alias test='./test'
in your .profile, and be happy. :)
Graham
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Graham Fawcett | Le Tue, 01 Nov 2011 18:23:52 +0000, Graham Fawcett a écrit :
> On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
>
>> Steven Schveighoffer Wrote:
>>
>>> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
>>>
>>> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
>>>
>>> I've since adopted the habit of calling test programs "testme" instead of "test" :)
>>
>> Huh, must port windows console to linux ^_^
>
> Too much work! Just put
>
> alias test='./test'
>
> in your .profile, and be happy. :)
>
> Graham
Excellent :D
++
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Graham Fawcett | On Tuesday, November 01, 2011 18:23:52 Graham Fawcett wrote:
> On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
> > Steven Schveighoffer Wrote:
> >> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
> >>
> >> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
> >>
> >> I've since adopted the habit of calling test programs "testme" instead of "test" :)
> >
> > Huh, must port windows console to linux ^_^
>
> Too much work! Just put
>
> alias test='./test'
>
> in your .profile, and be happy. :)
Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.
- Jonathan M Davis
|
November 01, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Tue, 01 Nov 2011 12:18:02 -0700, Jonathan M Davis wrote:
> On Tuesday, November 01, 2011 18:23:52 Graham Fawcett wrote:
>> On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
>> > Steven Schveighoffer Wrote:
>> >> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
>> >>
>> >> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
>> >>
>> >> I've since adopted the habit of calling test programs "testme" instead of "test" :)
>> >
>> > Huh, must port windows console to linux ^_^
>>
>> Too much work! Just put
>>
>> alias test='./test'
>>
>> in your .profile, and be happy. :)
>
> Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.
Agreed; if you're going to use a system, learn how to use it properly.
Then again, there's no shame in using "training wheels" if you're an absolute beginner. When I started using Unix, I was glad that the "dir" command was available on the system I was using. (I'm not sure if it was a binary, or whether a kindly sysop had provided an alias to "ls" for us Windows users). Learning is a journey of many small steps!
Graham
|
November 02, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Graham Fawcett | On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett@uwindsor.ca> wrote:
> On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
>
>> Steven Schveighoffer Wrote:
>>
>>> Oh I remember doing that too :) Don't feel bad, everyone does this at
>>> least once. I hate that stupid test builtin, nobody ever uses it
>>> anymore.
>>>
>>> Note, it's not a command line tool, it's a shell builtin, which is why
>>> it overrides anything in your search path.
>>>
>>> I've since adopted the habit of calling test programs "testme" instead
>>> of "test" :)
>>
>> Huh, must port windows console to linux ^_^
>
> Too much work! Just put
>
> alias test='./test'
>
> in your .profile, and be happy. :)
That's a cool trick :)
However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems. There must be some way to check for an interactive shell...
-Steve
|
November 02, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Wed, 02 Nov 2011 07:56:19 -0400, Steven Schveighoffer wrote:
> On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett@uwindsor.ca> wrote:
>
>> On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:
>>
>>> Steven Schveighoffer Wrote:
>>>
>>>> Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore.
>>>>
>>>> Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path.
>>>>
>>>> I've since adopted the habit of calling test programs "testme" instead of "test" :)
>>>
>>> Huh, must port windows console to linux ^_^
>>
>> Too much work! Just put
>>
>> alias test='./test'
>>
>> in your .profile, and be happy. :)
>
> That's a cool trick :)
>
> However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems. There must be some way to check for an interactive shell...
I can't speak for all shells, but bash and zsh don't expand aliases when you run a script. From the bash manual:
Aliases are not expanded when the shell is not interactive, unless the
expand_aliases shell option is set using shopt (see the description of
shopt under SHELL BUILTIN COMMANDS below).
Cheers,
Graham
|
November 02, 2011 Re: [beginner] Why nothing is printed to stdout ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | Jonathan M Davis Wrote:
> Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.
Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.
|
Copyright © 1999-2021 by the D Language Foundation