Skip to main content
added 516 characters in body
Source Link
fedorqui
  • 8.2k
  • 9
  • 38
  • 76

paste can also make it:

edited

This prints the first line again. Taking advantage of the lack of quotes, the trailing spaces are not showing:

$ paste -d"\t" <(printf "\n\n\n%s" $(head -1 file)) file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG

original

$ -d"\t" <(printf "\n\n\nCAT") file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG

paste can also make it:

$ paste -d"\t" <(printf "\n\n\nCAT") file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG

paste can also make it:

edited

This prints the first line again. Taking advantage of the lack of quotes, the trailing spaces are not showing:

$ paste -d"\t" <(printf "\n\n\n%s" $(head -1 file)) file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG

original

$ -d"\t" <(printf "\n\n\nCAT") file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
Source Link
fedorqui
  • 8.2k
  • 9
  • 38
  • 76

paste can also make it:

$ paste -d"\t" <(printf "\n\n\nCAT") file
                                    CAT
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG
CAT         DOG     DOG     DOG     DOG     DOG     DOG     DOG
            DOG     DOG     DOG     DOG     DOG     DOG     DOG