Sponsored Content
Top Forums Shell Programming and Scripting Need help in building Unix script Post 302303707 by susant.igate on Friday 3rd of April 2009 10:12:18 AM
Old 04-03-2009
Need help in building Unix script

Hi all,
We have a requirement like we need to create a program which will change a particular string in the file. For example

+=KA1238767 1121 3344645 686943 22356
01 567893 12435 12121 983627 121 1092 091217
02 may be for engine failure

In the above file we need to change the bold string to 56789C.
The new file will be as follows

+=KA1238767 1121 3344645 686943 22356
01 56789C 12435 12121 983627 121 1092 091217
02 may be for engine failure


The exact problem is the bold string may vary from time to time. It can be 145629 in that case the string which will be replaced with it is 14562I and so on. In general the last character needs to be changed to the corresponding alphabet. Eg.
1- A
2-B
3-C
4-D
5-E
....
9-I


Any type of suggestion or help will be highly appreciated.
Thank you in advance.

Regards
Susant
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

building flat files in unix and importing them from windows

what is a flat file in unix? i have to import a unix flat files from windows based programme. my question is not to export from unix but only to import from windows only. how to build that flat files? how to create export to windows how to import from windows (3 Replies)
Discussion started by: tunirayavarapu
3 Replies

2. Shell Programming and Scripting

building a SET clause in shell script

Hi, I have a comma delimited string, e.g. empno, ename, sal. Using Korn Shell Script I want to build the SET clause for an UPDATE statement, and set clause should look like this: empno=decode(:empno, '?', empno, :empno), ename=decode(:ename, '?', empno, :ename), sal=decode(:sal, '?',... (14 Replies)
Discussion started by: shalua
14 Replies

3. Shell Programming and Scripting

Help building the logic for a script

Hi guys, I am new to shell scripting, i need your help to tackle a problem. I have a single file, sample is below: 2008:07:08 07:01:14.360 (tid 4) INFO no bonus notifications to send 2008:07:08 07:01:50.823 (tid 1) INFO Database cleaned of all stale bonus records order than 30 days... (3 Replies)
Discussion started by: fahadaizaz
3 Replies

4. Shell Programming and Scripting

Building a Linux like LS for Unix

I'm trying to customize my environment at work in a Unix system. So I'm starting with the ls command... I'd like to make it run as the Linux ls... Even in color, if possible... My first problem is to make the file listing brake in columns... In fact, the actual ls from Unix does this, but... (3 Replies)
Discussion started by: 435 Gavea
3 Replies

5. UNIX for Dummies Questions & Answers

Building from scratch - UNIX

Hi! Any knows if Unix (from IBM, Sun, HP, etc) is picky on hardwares? I mean, installing Unix (not Linux) on a custom build system? Thanks. (2 Replies)
Discussion started by: genesisX
2 Replies

6. Shell Programming and Scripting

Need help in building Unix script

Hi all, We have a requirement like, There will be a file. For example the content will be as follows +=KA100012345678 0114092150R328abcdefgh D 345626 011409 1 2121212 232323 12121212 2323232323 1212121 We need to select the bold portion and change it to a... (11 Replies)
Discussion started by: susant.igate
11 Replies

7. UNIX for Advanced & Expert Users

Building a Unix Server from Scratch?

Hello Everyone, This post is a result of my search and quest to build a Unix Server at Home. I am familiar with the most of the systems such as, Solaris 10, HP-UX & Linux. Can somebody help me with more information about How to Build a Unix Server right from Fundamentals.... ? I have... (5 Replies)
Discussion started by: Vabiosis
5 Replies

8. UNIX for Dummies Questions & Answers

Error building program in UNIX

I'm trying to build a program and I'm getting a series of messages that I don't understand (new to UNIX): make: Entering directory `/disk/cg6/ccoda/code/proj/abrupt/exp/cam1/models/atm/cam/tools/scam/ui' g++ -c -Wall -g -DLINUX -DREAL_TYPE=double -DNeedFuncProto ... (7 Replies)
Discussion started by: bstephens
7 Replies

9. Shell Programming and Scripting

Building a dynamic UNIX menu with input files

Hi! I am looking to build dynamic menu (named: lookup.sh) that reads a pipe delimited file for input. for example, contents of input.txt could be: user1|srv1 user3|srv1 user4|srv1 user2|srv2 I want the menu look like: 1) get password for user1 on srv1 2) get password for user3 on... (7 Replies)
Discussion started by: cpolikowsky
7 Replies

10. What is on Your Mind?

UNIX: Building The Most Important OS in the World By John Loeffler

Nice UNIX history article by John Loeffler, February, 05th 2019 UNIX: Building The Most Important OS in the World The most widely used operating system in the world was a project born out of failure. (0 Replies)
Discussion started by: Neo
0 Replies
LR_ENVIRONMENT.IN(1)					  LogReport's Lire Documentation				      LR_ENVIRONMENT.IN(1)

NAME
lr_environment - Export Lire configuration in shell script form SYNOPSIS
eval `lr_environment` DESCRIPTION
The lr_environment command is used to import the Lire configuration in Lire shell scripts. All of Lire configuration variables will be written in a format that can be evaled by the shell. Shell scripts don't usually have to use that command, since it is done by the defaults file sourced by each command. The old names used by when the configuration was done in shell script are also exported by this script for backward compatibility. AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: lr_environment.in,v 1.12 2006/07/23 13:16:33 vanbaal Exp $ COPYRIGHT
Copyright (C) 2003 Stichting LogReport Foundation LogReport@LogReport.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 LR_ENVIRONMENT.IN(1)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy