Sample Header Ad - 728x90

Unable to grep foreign language in shell script

0 votes
2 answers
148 views
I am a newbie in shell scripting, I have a text which contain text in following format:- "some foreign language",'corresponding ID to text' for example:- "Назад",IDC_SSB_DLG_BACK_BTN I need to find the text related to ID and save in in text file. Here my sample script:- #!/bin/sh target_file=$1 output=$2 translationID=IDC_SSB_DLG_BACK_BTN translation=$(cat $target_file | grep $translationID) translationValue=$(echo "$translation" | awk -F',' '{print $1}') translationValueFinal=$(echo "$translationValue" | tr -d '"') echo "$translationValueFinal" >> $output while running this script I am getting error :-grep: (standard input): binary file matches Please suggest a way to grep and save a foriegn language in shell script. Thanks
Asked by tabish (510 rep)
Nov 7, 2023, 08:37 AM
Last activity: Nov 7, 2023, 04:52 PM