LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2008, 05:38 AM   #1
amit_pansuria
Member
 
Registered: Sep 2006
Posts: 73

Rep: Reputation: 15
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
 
Old 08-27-2008, 09:04 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,691

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by amit_pansuria View Post
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???
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to ssh from a shell script ? For ppl who can write shell scripts. thefountainhead100 Programming 14 10-22-2008 06:24 AM
running a shell script which invokes another shell program!!! raghu123 Programming 1 08-04-2008 09:10 AM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration