I have a text file that has over a hundred lines, each of which is an sh command:
echo foo
...
echo bar
I'm looking for an sh command that I can invoke from a terminal which will run the command from said file associated with a specified line number. I do not want the terminal to show the usual system-related content that is normally associated with commands run in a terminal.
For example, if I use something like xdotool type "$(sed -n 1p file)" &
(note that I'm open to a more elegant command),
I get the following terminal output:
[1] 9531
user@host:~$ echo foo
I wish to suppress the [1] 9531
line. Please keep in mind, however, that I do not wish to suppress the echo bar line, as that is where I have a chance to verify that I'm about to execute the desired command and not something else. Nor do I wish for any text to be displayed to the left of the command prompt.
I then hit the <Enter> key of my keyboard and get:
foo
[1]+ Done xdotool type "$(sed -n 1p file)" &
user@host:~$
I wish to suppress the [1]+ Done...
line.
How can I suppress the terminal output of said two lines? I've tried every redirect scheme I can find, with no joy.
xdotool...
command as shown in the OP, changing just the line number (goes a lot quicker). The output I want to suppress just gets in the way when I am running said procedure...