I was using "ansi2html.sh" here http://www.pixelbeat.org/scripts/ansi2html.sh to get my job done.
ls -lrt /web/htdocs | tail -12 | ./ansi2html.sh --bg=dark >test.html
I was using ansible on local host having Linux OS to run this across multiple hosts which generated the html files on each of the remote hosts and then i would finally pull all the html files from all remote to my local ansible server.
This worked fine for all Linux systems.
However, "ansi2html.sh" has dependency of gawk
which is not present on a set of production AiX 6.1 and 7 system.
I get this error:
./ansi2html.sh[38]: gawk: not found
As my AiX is hosting the production application; installing gawk
is not recommended.
I dont know if the solution could be to get the output of ls -lrt
from all AiX host and then feed that output to "ansi2html.sh" on the local ansible linux server having gawk
. Not sure if this will work and if so how ? Note: i wish the output to have the same look and feel as on the putty terminal prompt.
Can I get a solution for AiX so i could use ansible to get html files with the output of ls -lrt
from across all AiX hosts ?
(Already written as comment) You can use ssh
to execute a command on the remote computer and process the output on the local computer. Example:
ssh user@aixhost 'ls -lrt /web/htdocs | tail -12' |
./ansi2html.sh --bg=dark >test.html
Standard input can be redirected, too, e.g:
ssh user1@host1 'cd frompath; tar -czf - sendme/' |
ssh user2@host2 'cd topath; tar -xzf -'
Note: I know nothing about Ansible, but I heard that with it you can do almost everything you could do without it.