Click here to Skip to main content
15,042,403 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to store the pattern from the output of a command based on a condition using shell scripts
Camp=ABCD,App=Service
       state=COMMIT
Camp=XYZ,App=Service
       state=COMMIT>

I want to write a shell script which gives me value ABCD and XYZ in a variable , if state is equal to COMMIT.

I started writing, as I am new to shell programming
i am struck in giving the condition to store the date ABCD and XYZ in a variable
Posted
Updated 1-Feb-16 22:37pm
v2

1 solution

Read the man pages for the shell in question (man bash). It explains how to use variables in a script.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900