READING TIME 00:18

Basic phonebook via BASH

I’d like to write about the super cool bash technique I learned from a training video of 2011.

Yes, you can implement super basic phonebook application via shell script. Create a file called: phonebook

# phonebook

#!/usr/bin/env bash

# name phone-number
# name phone-number
# name phone-number
# name phone-number

grep -i $* <<EOF
vigo  0123-456-78-99
jack  0123-456-78-99
max   0123-456-78-99
turbo 0123-456-78-99
EOF

then make it executable: chmod +x phonebook. Now make query!

$ ./phonebook vigo
vigo 0123-456-78-99

Thanks to Carl Albing for Great Bash course at Safaribooks

By Year

There are “6” posts in blog archive.

2024 has 1 post

2022 has 3 posts

2019 has 1 post

2016 has 1 post