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 ...
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/*'; } |
...
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 ‘
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....
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 ...
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 :)
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shell × 11993bash × 4109
shell-script × 2388
linux × 1431
scripting × 728
command-line × 685
zsh × 518
quoting × 498
awk × 479
terminal × 444
sed × 423
ssh × 381
files × 375
text-processing × 374
io-redirection × 371
find × 366
grep × 347
pipe × 330
wildcards × 308
environment-variables × 270
variable × 246
ubuntu × 213
posix × 190
process × 185
filenames × 172