☰ Menu

      Introduction to the Command Line for Bioinformatics

Home
Introduction
Introduction to the Workshop and the Core
Schedule
Support
Slack
Zoom
Cheat Sheets
Windows 10 and Mac installation
CLI
Introduction to the Command Line 1
Introduction to the Command Line 2
Introduction to the Command Line 3
Day 3 Homework Solution
ETC
Closing thoughts
Github page
Biocore website

Day 3 Homework Solution

cat region.bed | while read line; do START=`echo -n $line | cut -d' ' -f2`; END=`echo -n $line | cut -d' ' -f3`; LEN=`expr $END - $START`; echo $LEN; done

#!/bin/bash
cat region.bed | grep ^$1 | while read line; do START=`echo -n $line | cut -d' ' -f2`; END=`echo -n $line | cut -d' ' -f3`; LEN=`expr $END - $START`; echo $LEN; done