LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   regarding shell script (https://www.linuxquestions.org/questions/programming-9/regarding-shell-script-665739/)

amit_pansuria 08-27-2008 05:38 AM

regarding shell script
 
Helo,

I have one configuration file sample.cfg in that there is one parameter

LANG:

and another parameter is

ENCODE:

now I want to write a shell script which reads value of LANG: in sample.cfg . Now if value of LANG:japanese
then set the ENCODE:UTF-JIS
other wise set its value as ENCODE:UTF-8


how to write such script

Regards,
Amit

TB0ne 08-27-2008 09:04 AM

Quote:

Originally Posted by amit_pansuria (Post 3261228)
Helo,

I have one configuration file sample.cfg in that there is one parameter

LANG:

and another parameter is

ENCODE:

now I want to write a shell script which reads value of LANG: in sample.cfg . Now if value of LANG:japanese
then set the ENCODE:UTF-JIS
other wise set its value as ENCODE:UTF-8

how to write such script

Open your config file first, and read the values in. Assign them to variables, test the variables, and take action, depending on how they're set. Post what code you've done, and what errors you're getting, and we'll be glad to help.

Or are you wanting someone to write this for you???


All times are GMT -5. The time now is 10:30 AM.