Skip to content

Instantly share code, notes, and snippets.

@lalitmee
Created April 8, 2021 03:58
Show Gist options
  • Save lalitmee/e964e782631a4eda2d5eaff47eee913d to your computer and use it in GitHub Desktop.
Save lalitmee/e964e782631a4eda2d5eaff47eee913d to your computer and use it in GitHub Desktop.
#!/bin/bash
result=$(grep -w "sales" "$1" | cut -d ' ' -f 4- | paste -sd+ | bc)
if [[ $result ]]
then
echo "Total Salary = $result"
else
echo "No employee found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment