Thursday 2010-09-02

How to redirect command output to an unnamed file descriptor in bash, so you can use the output easily for fd-only commands (e.g. diff two strings in bash).

pkgs_remote=$(ssh ${HOST_OLD} rpm -qa | grep -Ei '(httpd|php)' | sort)
pkgs_local=$(rpm -qa | grep -Ei '(httpd|php)' | sort)
diff <( echo ${pkgs_remote} ) <( echo ${pkgs_local} )