0

I have two commands which I want to close in variables:

val=`awk -F "\"" '{print $2}' ~/.cache/wal/colors-wal-dwm.h | sed -n -e 1,3p -e 5,7p`
dummy=`printf "dwm.normfgcolor:\ndwm.normbgcolor:\ndwm.normbordercolor:\ndwm.selfgcolor:\ndwm.selbgcolor:\ndwm.selbordercolor:")`

They basically print some stuff. I want to merge the output with paste command (this doesn't work):

paste <($dummy) <($val)

I wanted to avoid temp files but at this point I'm out of ideas. Thanks in advance.

1 Answer 1

2
$dummy

Is a variable, not a command to execute. echo is a command. printf is another command.

paste <(echo "$dummy") <(echo "$val")

Do not use backticks - $(..) instead. Check your scripts with shellcheck. You code is somewhat unreadable to me... if you don't care about variables, just don't use them.

awk -F '"' '{print $2}' ~/.cache/wal/colors-wal-dwm.h |
sed -n -e 1,3p -e 5,7p |
paste <(
     printf "dwm.%s:\n" \
        "normfgcolor" \
        "normbgcolor" \
        "normbordercolor" \
        "selfgcolor" \
        "selbgcolor" \
        "selbordercolor"
  ) -
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.