Hot answers tagged

8 votes

Two ssh output as awk input

Beware of those curly quotes (“ and ”) some Windows text editors will use, use straight quotes instead (' or "). You should also be using 's, unless you have some reason to use "s, e.g. to ...
Ed Morton's user avatar
  • 30.2k
7 votes
Accepted

Two ssh output as awk input

You need to group the commands. The simplest way is to use curly braces which group them without creating a subshell: { ssh username@host1 'cat /tmp/test/*'; ssh username@host2 'cat /tmp/test/*'; } | ...
terdon's user avatar
  • 239k
3 votes

Two ssh output as awk input

One possible way is to exec ssh command in subshell and pipe the result on awk: (ssh username@host1 "cat /tmp/test/*"; ssh username@host2 "cat /tmp/test/*" ) | awk ‘ command ‘
Romeo Ninov's user avatar
  • 17.1k
2 votes

make new directories/folders based on contents of column

I'm not sure what you mean by "contents of the folder" - are those contents directories or files of some sort? If directories this can be accomplished pretty easily with: < /tmp/input....
keithpjolley's user avatar
2 votes

Bash - Check if the standard input contains anything

[[ ! -t 0 ]] = Does standard input contains anything? Your premise is wrong. This tests whether stdin is connected to a terminal/tty, not whether stdin contains anything. Because of the negation the ...
Chris Davies's user avatar
1 vote
Accepted

Find file in directories of PATH env which match partially

This should do the work: compgen -c | grep 'YOUR_SEARCH_STRING' Example: compgen -c | grep '\-linux' Hope that helped :)
Pixelbog's user avatar
  • 661

Only top scored, non community-wiki answers of a minimum length are eligible