1

How do I redirect the output and redirect it back into the input. Basically to automatically type the text outputted, into the command line.

Like this command:

$ locate ifcfg-eth0

would normally output:

$ /etc/sysconfig/network-scripts/ifcfg-eth0

instead of clearing the command and creating a new line I want it to do this

$ /etc/sysconfig/network-scripts/ifcfg-eth0(cursor blinking here)
Dark Matter
  • 300
  • 2
  • 15

1 Answers1

0

We can do something like this with a tool named xclip

install xclip on debian

sudo apt-get install xclip

now use

locate ifcfg-eth0 | xclip

to paste the output use

xclip -o

For example: I have a file named scp.sh. I want to locate and run it.

locate scp.sh | xclip

then

xclip -o | bash