I've got configurations files in two differents directory. Each configuration files contains some information that I must have in order to send specific command.
I do not know how to do it. I belive I need a loop in function but I can't make it work.
Extension of configuration files are .cfg
The current directory is :
The Directory were are stored the OLD configuration files is :
Here is the contain of one configuration file
Info :
I must have, for each configuration file a resulat that will looks like this :
NOTE : for #brancheSpecifique# I need the last part of the line
ex : #brancheSpecifique# RESTART_SAT RESTART RESTART : I am keeping the last RESTART
I do not need to keep :
I hope you will be able to help me. I can't do it on my own. The LOOP will get all informations in ALL configuration files (current and OLD)
Using the hash # as a field separator in config file is a bad choice and may lead to confusion.
By convention, the # is used for commenting lines, so i suggest you to choose another delimiter (:;, colon in the example below) so you will stay compliant with the standard.
Thanks for the info but I can't change this. Is the way all configurations files are made. I am not the owner of the configuration files so I can't change them.
I will try this. I believe I will have to send this command line on both of directories to create a temporary file and then use a loop to read it line by line to send my specific command.
Hello Experts,
I have created one user confirmation process that will ask for user input. I have created one func for it. The issue is if i call it as normal then it works fine but if i am calling it in another script(in while loop) . It is going in infinite loop and not asking for user input. ... (8 Replies)
Hi All,
I have created one function for KSH and was running well with one parameter input since I just had to use $1 to get the parameter.
Now I want to do loop for each parameter(actually filenames) . I have try to use do loop, but $i does not resolve to parameter instead it resolves to 1,... (5 Replies)
Hi,
I was working on implementing error handling in my bash scripts, and decided to use trap to send myself an email incase of any errors. But it seems that somethings has gone wrong, and I am continuously getting same emails for an old error repeatedly (even though I have stopped/killed all... (1 Reply)
Hi ALL,
I want to replace string occurrence in my file "Config" using a external file named "Mapping" using awk.
$cat Config
! Configuration file for RAVI
! Configuration file for RACHANA
! Configuration file for BALLU
$cat Mapping
ravi:ram
rachana:shyam
ballu:hameed
The... (5 Replies)
my ksh script is not working...
i wanna remove lines in file2.txt from file1.txt
# cat file1.txt
this is line one
this is line two
this is line three
this is line four
this is line five
# cat file2.txt
this is line two
this is line three
# cat my_script.ksh
#!/bin/ksh
i=1
y=1... (8 Replies)
Hi all,
I am trying to call a function in for loop in the below format
#!/bin/bash
abc()
{
commands
}
for (( i=0; i<=10; i++ ))
do
abc
done
The error i am getting when trying to execute:
syntax error: unexpected end of file
canany one help me where i am going wrong?? (5 Replies)
Does anyone know what __read_nocancel does and why it would go into an infinite loop?
What I have gathered in my searches is that it pertains to server code. Yet, I'm not running this application in server mode.
NOTE: There are server functions in the shared object, but the specific code... (3 Replies)
Dear all
How to write the shell script for the following statement:
(C programming)
for (i=0;i<30;i++) {
if i=1
continue *skip this number
(To do function here....)
...
}
similar statement in while loop....
I wrote the script in sh... (3 Replies)
I having problem when I call this cleanupmenu function within a script. It continuously loops and goes to selection * That wasn't a valid selection. I have to kill it everytime to stop it. What am I doing wrong. I use this function menu in several other scripts and I don't have this problem at... (2 Replies)