Use este comando:
notify-send "$(more /home/tim/autest.sh | head -4 | tail -1)"
Quando você usa seu script com um atalho, more
informa:
::::::::::::::
/home/tim/autest.sh
::::::::::::::
#! /bin/bash
Aqui está um trecho do código-fonte de more.c
while (fnum < nfiles) {
if ((f = checkf (fnames[fnum], &clearit)) != NULL) {
context.line = context.chrctr = 0;
Currline = 0;
if (firstf) sigsetjmp (restore, 1);
if (firstf) {
firstf = 0;
if (srchopt) {
search (initbuf, f, 1);
if (noscroll)
left--;
}
else if (initopt)
skiplns (initline, f);
}
else if (fnum < nfiles && !no_tty) {
sigsetjmp (restore, 1);
left = command (fnames[fnum], f);
}
if (left != 0) {
if ((noscroll || clearit) && (file_size != LONG_MAX)) {
if (clreol)
home ();
else
doclear ();
}
if (prnames) {
if (bad_so)
erasep (0);
if (clreol)
cleareol ();
putsout("::::::::::::::");
if (promptlen > 14)
erasep (14);
putchar('\n');
if(clreol) cleareol();
puts(fnames[fnum]);
if(clreol) cleareol();
puts("::::::::::::::");
if (left > Lpp - 4)
left = Lpp - 4;
}
if (no_tty)
copy_file (f);
else {
within++;
screen(f, left);
within = 0;
}
}
sigsetjmp (restore, 1);
fflush(stdout);
fclose(f);
screen_start.line = screen_start.chrctr = 0L;
context.line = context.chrctr = 0L;
}
fnum++;
firstf = 0;
}