Sample Header Ad - 728x90

What is the difference between using code $variable and ${variable}2?

0 votes
5 answers
152 views
What is the difference between using code $variable and ${variable}2 ? Example: file ='GLOBAL_AR_COLLECTOR_COMMENTS20240614ALYSSAB.TXT' prefix ='GLOBAL_AR_COLLECTOR_COMMENTS' In my shell script code written like below, if echo $file |grep -q $prefix*.TXT if echo $file | grep -q ${prefix}2*.TXT i would like to know, what is the difference between both the if conditions?. What is the use of {prefix} ? , and why we are using 2 with ${prefix}2?
Asked by Celestica - Prabhahar Palanive (19 rep)
Jul 24, 2024, 05:57 AM
Last activity: Jul 25, 2024, 04:28 PM