Search code examples
linuxbashshellunixnano

Launch nano editor passing piped command


this is a curiosity. Can i start nano editor from bash, passing a piped command? this is my situation: I've a log file with dates formatted in tai64. For print my file i launch:

$> cat /var/log/qmail/current | tai64nlocal

that print what i want. but i want to view this in nano or another editor in one command. for example:

$> cat /var/log/qmail/current | tai64nlocal > nano

but this doesn't work. Any suggestion? Thanks in advance


Solution

  • Use process substitution:

    nano <(cat /var/log/qmail/current | tai64nlocal)
    

    Also, you don't need to use cat

    nano <(tai64nlocal < /var/log/qmail/current)