Command that exits with zero status (not /bin/true)?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
11
down vote
favorite
I've got a Makefile that runs a tool that takes a little while; it allows me to replace the command used:
make TOOL=alternative-tool
I'd like to skip that step in the Makefile, so I'm looking for a command that exits with status 0, and that has negligible side-effects.
Obviously, I could just use true
, but that's kinda confusing:
make TOOL=true
That reads as if I want to run the tool, but I don't.
Is there a default-installed executable that isn't /bin/true
that exits with status 0, and that has a catchy and easy to type name?
command-line
add a comment |Â
up vote
11
down vote
favorite
I've got a Makefile that runs a tool that takes a little while; it allows me to replace the command used:
make TOOL=alternative-tool
I'd like to skip that step in the Makefile, so I'm looking for a command that exits with status 0, and that has negligible side-effects.
Obviously, I could just use true
, but that's kinda confusing:
make TOOL=true
That reads as if I want to run the tool, but I don't.
Is there a default-installed executable that isn't /bin/true
that exits with status 0, and that has a catchy and easy to type name?
command-line
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
1
What line? TheTOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.
â Roger Lipscombe
Apr 20 at 18:45
add a comment |Â
up vote
11
down vote
favorite
up vote
11
down vote
favorite
I've got a Makefile that runs a tool that takes a little while; it allows me to replace the command used:
make TOOL=alternative-tool
I'd like to skip that step in the Makefile, so I'm looking for a command that exits with status 0, and that has negligible side-effects.
Obviously, I could just use true
, but that's kinda confusing:
make TOOL=true
That reads as if I want to run the tool, but I don't.
Is there a default-installed executable that isn't /bin/true
that exits with status 0, and that has a catchy and easy to type name?
command-line
I've got a Makefile that runs a tool that takes a little while; it allows me to replace the command used:
make TOOL=alternative-tool
I'd like to skip that step in the Makefile, so I'm looking for a command that exits with status 0, and that has negligible side-effects.
Obviously, I could just use true
, but that's kinda confusing:
make TOOL=true
That reads as if I want to run the tool, but I don't.
Is there a default-installed executable that isn't /bin/true
that exits with status 0, and that has a catchy and easy to type name?
command-line
edited Apr 20 at 18:15
asked Apr 19 at 11:34
Roger Lipscombe
17210
17210
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
1
What line? TheTOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.
â Roger Lipscombe
Apr 20 at 18:45
add a comment |Â
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
1
What line? TheTOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.
â Roger Lipscombe
Apr 20 at 18:45
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
1
1
What line? The
TOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.â Roger Lipscombe
Apr 20 at 18:45
What line? The
TOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.â Roger Lipscombe
Apr 20 at 18:45
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
42
down vote
accepted
Even though you've asked for something that is "not /bin/true
", replacing true
with the full name /bin/true
to show that it is the true
program rather than some other meaning of "true" is probably the best solution.
Your concern is that the true
in
make TOOL=true
appears to be something other than a command name. But if you write
make TOOL=/bin/true
then that is unambiguously a command. Somebody might misread TOOL=true
to mean that some other tool somewhere is intended, but no such misreading of TOOL=/bin/true
is likely.
I am unsure as to when :
, which is a shell builtin but not an external command, will work. Henning Makholm has reported that it appears to work. But I think it does not work in all situations, and you found that it did not work for you.
As for a shell alias, you cannot use that because alias expansion is not performed in the arguments you pass to a command, nor do makefiles make any use of previously defined shell aliases. Even if make
runs your commands in a new shell, that shell will not have the alias (and would not use it even if it did have it, because it would be a noninteractive shell, where alias expansion is not automatically enabled).
1
Using:
seems to work fine for me.make
always spawns a shell to run each command after it's done its own substitutions.
â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory withhello.c
and no makefile, wheremake hello
compileshello.c
tohello
, I foundmake CC=: hello
behaved according to what you are saying.
â Eliah Kagan
Apr 19 at 13:04
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using:
doesn't work. Being explicit about/bin/true
is probably the best way to do it.
â Roger Lipscombe
Apr 19 at 14:22
add a comment |Â
up vote
9
down vote
While I agree that using the full path to true
would be the best solution, I'd like to note what's probably by far the most common way to avoid real command execution: sticking an echo
in front of it. So:
make TOOL=echo
I think this is sometimes useful when it's important one be reminded that one suppressed whatever actionTOOL
would otherwise do. Without-s
or equivalent,make
emits redundant information, because bothmake
and theecho
command run bymake
separately emit output. For example, when I runmake CC=echo hello
in a directory that hashello.c
and no makefile, I getecho hello.c -o hello
as the first line of output andhello.c -o hello
as the second. But some builds use (or the user may add)-s
, and then it's helpful.make -s CC=echo hello
gives justhello.c -o hello
.
â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
add a comment |Â
up vote
6
down vote
You can always make your own command that does nothing but return a zero exit status. Some options:
an appropriately named symbolic link to
/bin/true
an empty shell script
a nearly empty C program:
int main()
return 0;
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
add a comment |Â
up vote
0
down vote
Create a symbolic link in the working directory to /bin/true named something like skip
. Thus...
skip -> /bin/true
Then the make line can be ...
make TOOL=./skip
add a comment |Â
up vote
-2
down vote
Here's a way to do it with slightly more characters:
function T() /bin/true;
After you've done it once you can re-execute it just by using the name T
.
false; T; echo $?
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
42
down vote
accepted
Even though you've asked for something that is "not /bin/true
", replacing true
with the full name /bin/true
to show that it is the true
program rather than some other meaning of "true" is probably the best solution.
Your concern is that the true
in
make TOOL=true
appears to be something other than a command name. But if you write
make TOOL=/bin/true
then that is unambiguously a command. Somebody might misread TOOL=true
to mean that some other tool somewhere is intended, but no such misreading of TOOL=/bin/true
is likely.
I am unsure as to when :
, which is a shell builtin but not an external command, will work. Henning Makholm has reported that it appears to work. But I think it does not work in all situations, and you found that it did not work for you.
As for a shell alias, you cannot use that because alias expansion is not performed in the arguments you pass to a command, nor do makefiles make any use of previously defined shell aliases. Even if make
runs your commands in a new shell, that shell will not have the alias (and would not use it even if it did have it, because it would be a noninteractive shell, where alias expansion is not automatically enabled).
1
Using:
seems to work fine for me.make
always spawns a shell to run each command after it's done its own substitutions.
â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory withhello.c
and no makefile, wheremake hello
compileshello.c
tohello
, I foundmake CC=: hello
behaved according to what you are saying.
â Eliah Kagan
Apr 19 at 13:04
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using:
doesn't work. Being explicit about/bin/true
is probably the best way to do it.
â Roger Lipscombe
Apr 19 at 14:22
add a comment |Â
up vote
42
down vote
accepted
Even though you've asked for something that is "not /bin/true
", replacing true
with the full name /bin/true
to show that it is the true
program rather than some other meaning of "true" is probably the best solution.
Your concern is that the true
in
make TOOL=true
appears to be something other than a command name. But if you write
make TOOL=/bin/true
then that is unambiguously a command. Somebody might misread TOOL=true
to mean that some other tool somewhere is intended, but no such misreading of TOOL=/bin/true
is likely.
I am unsure as to when :
, which is a shell builtin but not an external command, will work. Henning Makholm has reported that it appears to work. But I think it does not work in all situations, and you found that it did not work for you.
As for a shell alias, you cannot use that because alias expansion is not performed in the arguments you pass to a command, nor do makefiles make any use of previously defined shell aliases. Even if make
runs your commands in a new shell, that shell will not have the alias (and would not use it even if it did have it, because it would be a noninteractive shell, where alias expansion is not automatically enabled).
1
Using:
seems to work fine for me.make
always spawns a shell to run each command after it's done its own substitutions.
â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory withhello.c
and no makefile, wheremake hello
compileshello.c
tohello
, I foundmake CC=: hello
behaved according to what you are saying.
â Eliah Kagan
Apr 19 at 13:04
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using:
doesn't work. Being explicit about/bin/true
is probably the best way to do it.
â Roger Lipscombe
Apr 19 at 14:22
add a comment |Â
up vote
42
down vote
accepted
up vote
42
down vote
accepted
Even though you've asked for something that is "not /bin/true
", replacing true
with the full name /bin/true
to show that it is the true
program rather than some other meaning of "true" is probably the best solution.
Your concern is that the true
in
make TOOL=true
appears to be something other than a command name. But if you write
make TOOL=/bin/true
then that is unambiguously a command. Somebody might misread TOOL=true
to mean that some other tool somewhere is intended, but no such misreading of TOOL=/bin/true
is likely.
I am unsure as to when :
, which is a shell builtin but not an external command, will work. Henning Makholm has reported that it appears to work. But I think it does not work in all situations, and you found that it did not work for you.
As for a shell alias, you cannot use that because alias expansion is not performed in the arguments you pass to a command, nor do makefiles make any use of previously defined shell aliases. Even if make
runs your commands in a new shell, that shell will not have the alias (and would not use it even if it did have it, because it would be a noninteractive shell, where alias expansion is not automatically enabled).
Even though you've asked for something that is "not /bin/true
", replacing true
with the full name /bin/true
to show that it is the true
program rather than some other meaning of "true" is probably the best solution.
Your concern is that the true
in
make TOOL=true
appears to be something other than a command name. But if you write
make TOOL=/bin/true
then that is unambiguously a command. Somebody might misread TOOL=true
to mean that some other tool somewhere is intended, but no such misreading of TOOL=/bin/true
is likely.
I am unsure as to when :
, which is a shell builtin but not an external command, will work. Henning Makholm has reported that it appears to work. But I think it does not work in all situations, and you found that it did not work for you.
As for a shell alias, you cannot use that because alias expansion is not performed in the arguments you pass to a command, nor do makefiles make any use of previously defined shell aliases. Even if make
runs your commands in a new shell, that shell will not have the alias (and would not use it even if it did have it, because it would be a noninteractive shell, where alias expansion is not automatically enabled).
edited Apr 19 at 15:26
answered Apr 19 at 11:46
Eliah Kagan
79.5k20221359
79.5k20221359
1
Using:
seems to work fine for me.make
always spawns a shell to run each command after it's done its own substitutions.
â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory withhello.c
and no makefile, wheremake hello
compileshello.c
tohello
, I foundmake CC=: hello
behaved according to what you are saying.
â Eliah Kagan
Apr 19 at 13:04
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using:
doesn't work. Being explicit about/bin/true
is probably the best way to do it.
â Roger Lipscombe
Apr 19 at 14:22
add a comment |Â
1
Using:
seems to work fine for me.make
always spawns a shell to run each command after it's done its own substitutions.
â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory withhello.c
and no makefile, wheremake hello
compileshello.c
tohello
, I foundmake CC=: hello
behaved according to what you are saying.
â Eliah Kagan
Apr 19 at 13:04
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using:
doesn't work. Being explicit about/bin/true
is probably the best way to do it.
â Roger Lipscombe
Apr 19 at 14:22
1
1
Using
:
seems to work fine for me. make
always spawns a shell to run each command after it's done its own substitutions.â Henning Makholm
Apr 19 at 12:49
Using
:
seems to work fine for me. make
always spawns a shell to run each command after it's done its own substitutions.â Henning Makholm
Apr 19 at 12:49
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest
:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory with hello.c
and no makefile, where make hello
compiles hello.c
to hello
, I found make CC=: hello
behaved according to what you are saying.â Eliah Kagan
Apr 19 at 13:04
@HenningMakholm Thanks, I've edited. You may want to post an answer. Lok Lam Cheng had commented on the question to suggest
:
, but it should be an answer (especially if correct) and that comment doesn't explain why one should expect it to work. In a directory with hello.c
and no makefile, where make hello
compiles hello.c
to hello
, I found make CC=: hello
behaved according to what you are saying.â Eliah Kagan
Apr 19 at 13:04
2
2
Unfortunately, for this particular Makefile (it uses erlang.mk), using
:
doesn't work. Being explicit about /bin/true
is probably the best way to do it.â Roger Lipscombe
Apr 19 at 14:22
Unfortunately, for this particular Makefile (it uses erlang.mk), using
:
doesn't work. Being explicit about /bin/true
is probably the best way to do it.â Roger Lipscombe
Apr 19 at 14:22
add a comment |Â
up vote
9
down vote
While I agree that using the full path to true
would be the best solution, I'd like to note what's probably by far the most common way to avoid real command execution: sticking an echo
in front of it. So:
make TOOL=echo
I think this is sometimes useful when it's important one be reminded that one suppressed whatever actionTOOL
would otherwise do. Without-s
or equivalent,make
emits redundant information, because bothmake
and theecho
command run bymake
separately emit output. For example, when I runmake CC=echo hello
in a directory that hashello.c
and no makefile, I getecho hello.c -o hello
as the first line of output andhello.c -o hello
as the second. But some builds use (or the user may add)-s
, and then it's helpful.make -s CC=echo hello
gives justhello.c -o hello
.
â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
add a comment |Â
up vote
9
down vote
While I agree that using the full path to true
would be the best solution, I'd like to note what's probably by far the most common way to avoid real command execution: sticking an echo
in front of it. So:
make TOOL=echo
I think this is sometimes useful when it's important one be reminded that one suppressed whatever actionTOOL
would otherwise do. Without-s
or equivalent,make
emits redundant information, because bothmake
and theecho
command run bymake
separately emit output. For example, when I runmake CC=echo hello
in a directory that hashello.c
and no makefile, I getecho hello.c -o hello
as the first line of output andhello.c -o hello
as the second. But some builds use (or the user may add)-s
, and then it's helpful.make -s CC=echo hello
gives justhello.c -o hello
.
â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
add a comment |Â
up vote
9
down vote
up vote
9
down vote
While I agree that using the full path to true
would be the best solution, I'd like to note what's probably by far the most common way to avoid real command execution: sticking an echo
in front of it. So:
make TOOL=echo
While I agree that using the full path to true
would be the best solution, I'd like to note what's probably by far the most common way to avoid real command execution: sticking an echo
in front of it. So:
make TOOL=echo
answered Apr 19 at 14:49
muru
129k19272462
129k19272462
I think this is sometimes useful when it's important one be reminded that one suppressed whatever actionTOOL
would otherwise do. Without-s
or equivalent,make
emits redundant information, because bothmake
and theecho
command run bymake
separately emit output. For example, when I runmake CC=echo hello
in a directory that hashello.c
and no makefile, I getecho hello.c -o hello
as the first line of output andhello.c -o hello
as the second. But some builds use (or the user may add)-s
, and then it's helpful.make -s CC=echo hello
gives justhello.c -o hello
.
â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
add a comment |Â
I think this is sometimes useful when it's important one be reminded that one suppressed whatever actionTOOL
would otherwise do. Without-s
or equivalent,make
emits redundant information, because bothmake
and theecho
command run bymake
separately emit output. For example, when I runmake CC=echo hello
in a directory that hashello.c
and no makefile, I getecho hello.c -o hello
as the first line of output andhello.c -o hello
as the second. But some builds use (or the user may add)-s
, and then it's helpful.make -s CC=echo hello
gives justhello.c -o hello
.
â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
I think this is sometimes useful when it's important one be reminded that one suppressed whatever action
TOOL
would otherwise do. Without -s
or equivalent, make
emits redundant information, because both make
and the echo
command run by make
separately emit output. For example, when I run make CC=echo hello
in a directory that has hello.c
and no makefile, I get echo hello.c -o hello
as the first line of output and hello.c -o hello
as the second. But some builds use (or the user may add) -s
, and then it's helpful. make -s CC=echo hello
gives just hello.c -o hello
.â Eliah Kagan
Apr 19 at 15:23
I think this is sometimes useful when it's important one be reminded that one suppressed whatever action
TOOL
would otherwise do. Without -s
or equivalent, make
emits redundant information, because both make
and the echo
command run by make
separately emit output. For example, when I run make CC=echo hello
in a directory that has hello.c
and no makefile, I get echo hello.c -o hello
as the first line of output and hello.c -o hello
as the second. But some builds use (or the user may add) -s
, and then it's helpful. make -s CC=echo hello
gives just hello.c -o hello
.â Eliah Kagan
Apr 19 at 15:23
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
(which might still be useful if the commands involve shell expansions, so you can get a clearer idea of what's being run, if interested)
â muru
Apr 19 at 15:57
add a comment |Â
up vote
6
down vote
You can always make your own command that does nothing but return a zero exit status. Some options:
an appropriately named symbolic link to
/bin/true
an empty shell script
a nearly empty C program:
int main()
return 0;
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
add a comment |Â
up vote
6
down vote
You can always make your own command that does nothing but return a zero exit status. Some options:
an appropriately named symbolic link to
/bin/true
an empty shell script
a nearly empty C program:
int main()
return 0;
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
add a comment |Â
up vote
6
down vote
up vote
6
down vote
You can always make your own command that does nothing but return a zero exit status. Some options:
an appropriately named symbolic link to
/bin/true
an empty shell script
a nearly empty C program:
int main()
return 0;
You can always make your own command that does nothing but return a zero exit status. Some options:
an appropriately named symbolic link to
/bin/true
an empty shell script
a nearly empty C program:
int main()
return 0;
answered Apr 19 at 15:17
![](https://i.stack.imgur.com/E0SEH.png?s=32&g=1)
![](https://i.stack.imgur.com/E0SEH.png?s=32&g=1)
David Foerster
26.1k1361106
26.1k1361106
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
add a comment |Â
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
A good name for such a program would be noop or no-op.
â arp
Apr 20 at 22:15
add a comment |Â
up vote
0
down vote
Create a symbolic link in the working directory to /bin/true named something like skip
. Thus...
skip -> /bin/true
Then the make line can be ...
make TOOL=./skip
add a comment |Â
up vote
0
down vote
Create a symbolic link in the working directory to /bin/true named something like skip
. Thus...
skip -> /bin/true
Then the make line can be ...
make TOOL=./skip
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Create a symbolic link in the working directory to /bin/true named something like skip
. Thus...
skip -> /bin/true
Then the make line can be ...
make TOOL=./skip
Create a symbolic link in the working directory to /bin/true named something like skip
. Thus...
skip -> /bin/true
Then the make line can be ...
make TOOL=./skip
answered Apr 24 at 22:07
DocSalvager
4351614
4351614
add a comment |Â
add a comment |Â
up vote
-2
down vote
Here's a way to do it with slightly more characters:
function T() /bin/true;
After you've done it once you can re-execute it just by using the name T
.
false; T; echo $?
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
add a comment |Â
up vote
-2
down vote
Here's a way to do it with slightly more characters:
function T() /bin/true;
After you've done it once you can re-execute it just by using the name T
.
false; T; echo $?
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
add a comment |Â
up vote
-2
down vote
up vote
-2
down vote
Here's a way to do it with slightly more characters:
function T() /bin/true;
After you've done it once you can re-execute it just by using the name T
.
false; T; echo $?
Here's a way to do it with slightly more characters:
function T() /bin/true;
After you've done it once you can re-execute it just by using the name T
.
false; T; echo $?
edited Apr 20 at 22:20
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
![](https://i.stack.imgur.com/eVuAv.png?s=32&g=1)
wjandrea
7,16342255
7,16342255
answered Apr 20 at 18:08
Lee B
1
1
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
add a comment |Â
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
3
3
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
Could you please explain how this function can be invoked from a Make variable value (to be of use in the situation in question)?
â David Foerster
Apr 20 at 22:17
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026369%2fcommand-that-exits-with-zero-status-not-bin-true%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Makefiles support comments, gnu.org/software/make/manual/html_node/Makefile-Contents.html . Put a comment before the line and document your code. That reduces confusion and explains why you used a certain approach.
â Freiheit
Apr 20 at 18:33
1
What line? The
TOOL=true
will be on the command line when invoking make, probably documented in a README nearby. The actual line that invokes the tool is somewhere within a 7000-line (third party) makefile.â Roger Lipscombe
Apr 20 at 18:45