On 1/11/20 6:10 PM, Boris Kotov wrote: > Most people are doing this blackbox approach: > > ``` > > scripts/ > > hello.sh > > build.sh > > push.sh > > ``` > > > Blackbox, because its not clear what's in there, you have open each > file, then your whole terminal window or IDE fills an empty file with > one/two valuable lines.
for i in scripts/*.sh; do
printf "%s\n" " --> $i"
cat "$i"
done
Will print out all scripts prefixed by their name, onto one screen.
util-linux "more", but not busybox "more", will display multiple files
prefixed by:
::::::::::::::
filename
::::::::::::::
So you could use `more scripts/*.sh | cat` to suppress paging and dump
many scripts onto one screen of text:
$ more scripts/*.sh | cat
::::::::::::::
scripts/build.sh
::::::::::::::
#!/bin/sh
docker build -t image .
::::::::::::::
scripts/hello.sh
::::::::::::::
#!/bin/sh
echo hello
::::::::::::::
scripts/push.sh
::::::::::::::
#!/bin/sh
docker push -t image
$
> However Makefile syntax is very nice, could we just include something
> like `minimake` or called it (do) which only supports naming tasks?
I would be concerned about such a feature, because if it tries to read a
file called "Makefile" then that could result in confusing errors for
actual Makefiles.
As far as naming tasks goes, shellscripts also "name tasks", without
offering the primary feature of Make, which is detecting out-of-date
targets via timestamps.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
signature.asc
Description: OpenPGP digital signature
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
