2018-06-04 12:21:53 +02:00
|
|
|
---
|
2018-06-04 18:59:07 +02:00
|
|
|
description: |
|
|
|
|
All these examples only work with GNU `make` due to the lack of support of the
|
|
|
|
`--eval` flag. The same can be achieved by using a proper `Makefile` of by
|
|
|
|
passing the content via stdin, that is:
|
|
|
|
|
|
|
|
```
|
|
|
|
make -s --eval=<commands>
|
|
|
|
```
|
|
|
|
|
|
|
|
becomes:
|
|
|
|
|
|
|
|
```
|
|
|
|
make -s -f <(echo <commands>)
|
|
|
|
```
|
2018-06-04 12:21:53 +02:00
|
|
|
functions:
|
|
|
|
execute-interactive:
|
|
|
|
- code: |
|
2018-06-04 18:28:58 +02:00
|
|
|
COMMAND='/bin/sh'
|
|
|
|
make -s --eval=$'x:\n\t-'"$COMMAND"
|
2018-06-04 12:21:53 +02:00
|
|
|
sudo-enabled:
|
|
|
|
- code: |
|
2018-06-04 18:28:58 +02:00
|
|
|
COMMAND='/bin/sh'
|
|
|
|
sudo make -s --eval=$'x:\n\t-'"$COMMAND"
|
2018-06-04 12:21:53 +02:00
|
|
|
suid-enabled:
|
|
|
|
- code: |
|
2018-06-04 19:13:16 +02:00
|
|
|
COMMAND='/bin/sh -p'
|
2018-06-04 18:28:58 +02:00
|
|
|
./make -s --eval=$'x:\n\t-'"$COMMAND"
|
2018-06-04 12:21:53 +02:00
|
|
|
file-write:
|
|
|
|
- code: |
|
|
|
|
LFILE=file_to_write
|
2018-06-04 18:28:58 +02:00
|
|
|
make -s --eval="\$(file >$LFILE,data)" .
|
2018-06-04 12:21:53 +02:00
|
|
|
---
|