lundi 16 février 2015

display filename followed by content without interaction


My program writes it state to few files every 30 seconds or so (overwrites) and I would like to look at them with the filenames displayed like "more" does. Like:



$ echo 1234 > test00
$ echo 5678 > test01
$ ls
test00 test01
$ more *
::::::::::::::
test00
::::::::::::::
1234
::::::::::::::
test01
::::::::::::::
5678


For "more" you have to press space to get next file.



  • What I want is the filenames before content in some way

  • I tried "tail", but have to Ctrl+C, Can write a small program but I’m wondering if any standard unix program can do this ( display name of file, followed by content of file ) without further user interaction as with "more"



Aucun commentaire:

Enregistrer un commentaire