#!/bin/bash line=’this “is” a command;this “is” a pattern’ COMMAND=${line%;*} PATTERN=${line#*;} echo $COMMAND echo $PATTERN And the output would be: this “is” a command this “is” a pattern