commit adbefe9da346d03eb1e5493b39716ed1537c93ed
parent 9a6cb17053ed2eb8acc92ae5ef7d4f5e980b6029
Author: St John Karp <contact@stjo.hn>
Date: Wed, 20 Jul 2022 16:05:39 -0400
svc: Replace use of xargs
The -I flag for xargs is not supported by sbase so I replaced it
with a short loop into which the results of find are piped.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/core/svc/build b/core/svc/build
@@ -1,8 +1,11 @@
#!/usr/bin/env sh
# Switch all the paths from /bin to to /usr/bin.
-find . -type f -exec grep -l '/bin/svc\.d' {} \+ |
- xargs -I % sh -c "sed 's|/bin/svc\.d|/usr/bin/svc.d|g' % > _ && mv _ %"
+find . -type f -exec grep -l '/bin/' {} \+ |
+ while IFS= read -r file ; do
+ sed 's|/bin/|/usr/bin/|g' "$file" > _
+ mv -f _ "$file"
+ done
# pgrep works better than pidof, especially when a daemon has
# forked to the background. Neither is POSIX, so I don't suppose it matters.
sed 's/pidof -o %PPID \$BIN/pgrep ^\$SERVICE\$/' svc.d/bare.sh > _