Read the file config_details.txt in loop and go through the records in the file from second line onwards.
Login to the server based on the IP address, username, password provided in the config_details.txt file.
Go to the path as mentioned in directory_path.
Copy the file e.g. error.log to the local directory.
Move to the next server details in the config_Details.txt file and repeat step 1to 5.
There are other steps involved in this script which I have managed to do already. I can read from the file using below code. But I cannot read the variables e.g.server name or username etc from the file. It is either full line or nothing.
Any help would be appreciated.
Thanks
Chetan
Moderator's Comments:
Please use CODE tags as required by forum rules!
DON'T use FONT and SIZE that abundantly!
Last edited by rbatte1; 11-28-2016 at 08:53 AM..
Reason: RudiC: Added CODE tags and removed FONT and SIZE tags. ; rbatte1: Converted text numbered list to formatted numbered list
Hi,
As per shell docs because commands in pipelines are run as separate processes,
variables set in a pipeline have no effect on the parent shell
In the sample below I am unable to set variable in Proc1 so that I can see it in the main program
Is there any work around ?
Thanks
Zam... (4 Replies)
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
# include <stdio.h>
# include <fcntl.h>
# include <stdlib.h>
# include <sys/stat.h>
int main(int argc, char *argv)
{
int fRead, fPadded, padVal;
int btRead;
int BUFFSIZE = 512;
char buff;
if (argc != 4)
{
printf ("Please provide all of the... (3 Replies)
Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP.
I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Hi
Here is my script that calls my awk script
#!/bin/bash
set -x
dir="/var/local/dsx/csv"
testfile="$testfile"
while getopts " f: " option
do
case $option in
f ) testfile="$OPTARG";;
esac;
done
./scriptFile --testfile=$testfile >> $dir/$testfile.csv
It calls my awk... (1 Reply)
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Hi,
I am facing issues with the below:
I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,).
Now i want to read this command from file and execute it.
So my code below is :
Contents in the lookup.lkp file is :
c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
HELLO
I need your help please , i need to read a file that contain a table like :
Name | Status
------------------
DB 1 | UP
DB 2 | UP
DB 3 | DOWN
DB 4 | UP
DB 5 | UP
the objective to read each line and check if DB is UP or Down and give me the name of Down database.... (10 Replies)