#!/bin/bash state="$1" case $state in 1) gr=enabled ;; 0) gr=disabled ;; esac cd /opt/ksp cat phones.txt | awk '{print $1}' | grep '^[3-5]' | xargs -i -n1 -P0 ./autoanswer_line.sh '{}' "$state" | grep $gr | cut -d. -f4| cut -d' ' -f1