Created
July 21, 2022 16:36
-
-
Save opplatek/8a5975c0f5c7740aaf12bb1fe4e34c51 to your computer and use it in GitHub Desktop.
Replace first line in a file (or insert first line)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Replace first line in a file | |
# | |
# Insert first line | |
echo -e "a\nb" | sed '1i transcript_id\tlength' | |
# Replace - remove and replace first line | |
echo -e "a\nb" | tail -n+2 | sed '1i transcript_id\tlength' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment