Skip to content

Instantly share code, notes, and snippets.

@kunpengku
Created June 16, 2014 06:35
Show Gist options
  • Save kunpengku/7637b110010822a62edd to your computer and use it in GitHub Desktop.
Save kunpengku/7637b110010822a62edd to your computer and use it in GitHub Desktop.
怎么取文件的前两行
#!/bin/bash
File=/etc/fstab
{
read line1
read line2
} < $File
echo "First line is $line1"
echo "First line is $line2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment