New answers tagged

2

This will work using any awk in any shell on every UNIX box: $ awk '/^ *\[\.\//{title=$1} /^ *input =/{print FILENAME ":", title, "=", $NF}' */*/assessment 01/to/assessment: [./input_file_01] = 'input_file_01.i' 02/to/assessment: [./input_file_02] = 'input_file_02.i' 02/to/assessment: [./input_file_02b] = 'input_file_02b.i'


1

unset `env | grep _PROXY | egrep -o '^[^=]+'`


0

Using GNU Parallel (> version 20180122): parallel --tmux --fg echo ::: 1 2 3 4


3

The shell sets up the redirection before your pipeline is run. Instead, you could use something like find ./ -name '*.txt' -exec sh -c 'for f; do echo "some string" > "$f".alt; done' sh {} +


2

XARGS(1): If any invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input. It would be possible to use a subshell to return 255: find . -name "Makefile" | xargs dirname | \ xargs -I {} sh -c 'make -C "$1" build || exit 255' sh {}


Top 50 recent answers are included