#!/bin/bashx="Mobile:25:15000#TV:10:20000#Laptop:20:65000"y="Laptop"o_str=$(awk -v y="$y" -F: 'BEGIN{RS="#"} $1 == y' <<< "$x");echo "$o_str"
Standard input is empty
Laptop:20:65000
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!