New answers tagged

0

text1="word1 word2 word3" text2="word4 word5" text3="word6 word7 word8" set -f #disable globbing in unquoted var expansions (optional) for i in text1 text2 text3; do eval "j=\$$i" #i holds name, $j holds the fields for k in $j; do #k holds a field echo "$k in $i" done done Output: word1 in text1 word2 in text1 word3 in text1 word4 in ...


0

1: use readlink -f : $ echo "123" > orgin $ ln -s orgin sym1 $ ln -s sym1 sym2 $ readlink -f ./sym2 /tmp/orgin 2: or if switch -f of readlink if unavailable; you can use this script: #!/bin/bash function sym_to_abs(){ t=${1:?'PARAMETR NOT FOUND'} dirname=$(dirname "$t") filename=$(basename "$t") [[ ! $dirname =~ ^\/ ]] && ...


1

Apparently the dash version of fg have some bug or limitation to bring up the process when using a string instead of the job number. What you can do is to use the number instead of the process name, like that: fg %1 Im very sorry to say that! In bash it works fine with the name, remember that fg is a shell built-in for the two shells, so fg of bash ...


5

This looks like a bug; the loop which handles strings in this context doesn't have a valid exit condition: while (1) { if (!jp) goto err; if (match(jp->ps[0].cmd, p)) { if (found) goto err; found = jp; ...



Top 50 recent answers are included