1

lets say when I execute command and then grep it for a specific output.

for example: man cat|grep "Written"

This gives the name of the authors.

My problem is I want to do this via read.

here is an example of my script:

#!/bin/bash

read variable #lets say input is: man cat|grep "Written"

$variable

It does not seem to work. I need this to work as I am doing a larger script and this part got me stuck. Any tips are appreciated.

5

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.