I recently became a Sysadmin for the company I work for. One of the things I want to try and do is improve some of the processes with scripts. I am very new to bash but eager to learn and any help would be appreciated.
In my work if someone requests a grep
we have to manually connect to the hostname and then become root and, after that perform the grep
. This can be quite time consuming and so I started working on a script which would allow me to enter the following:
ssh user@hostname grep
The problem is I have no idea how to be able to connect to a given hostname. I would like some output when I run the script that asks me for the hostname which I type in and then asks me what I want to grep
and from that I get my results.
Any help would be appreciated and apologies if this is a long winded post. It's my first time asking a question.