linux-How to join multiple lines of file names into one with custom delimiter?- Stack Overflow
(uname-n; cat/proc/meminfo | head-1 | awk' {print$2}') | tr'\n' ' '
So what do you think?
It's already been resolved, but it's a different answer.
$echo-n "$(uname-n)"; cat/proc/meminfo|awk'NR==1 {print$2}'
$ set --$(uname-n; cat/proc/meminfo | awk'NR==1 {print$2}'); echo "$1$2"
$ printf "%s%s\n"$(uname-n; cat/proc/meminfo | awk'NR==1 {print$2}')
$ cat/proc/meminfo | awk-vuname="$(uname-n)"'NR==1 {print uname"""$2}'
I would do it like this.
echo$(uname-n; cat/proc/meminfo|head-1|awk'{print$2}')
It's a different solution.
Use paste
to combine multiple lines (fixed lines) into a single line.
(uname-n; cat/proc/meminfo | head-1) | paste- -
If you want to summarize n lines, write n -
of paste-
.
Is that so?
$(uname-n; cat/proc/meminfo|head-1|awk'{print$2}')|xargs
c809051830b8152984
© 2024 OneMinuteCode. All rights reserved.