Last active
January 7, 2016 12:40
-
-
Save snoek09/0117a3ec64a243e7180e to your computer and use it in GitHub Desktop.
Bash script to use a file with line numbers to get the content from those lines from another file
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 | |
# Usage get_line_content_from_file.sh file_containing_linenumbers_only file | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
awk '{ if(NR==n) print $0 }' n=$line $2 | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment