sed search and read the RHS information: Linux 2.6.9-89
Hi,
I have a config_file.cfg with the content:
so on for 28 times.
As you might have guessed it; the script I have to write is to read this config file and get the FTP server info based upon the FILE_ID. The user will provide FILE_ID as the parameter to the script (say ftp.ksh).
./ftp.ksh 1
now ftp.ksh script should read the config file and get <FTP_SERVER1.COM> info to connect to ftp server corresponding to FILE_ID_1
if user enters ./ftp.ksh 2
then ftp.ksh script should read the config file and get <FTP_SERVER2.COM> info to connect to ftp server corresponding to FILE_ID_2
can I have a sed command to search for the pattern as:
In one of the post in this forum https://www.unix.com/shell-programmin...ters-line.html; one of the solution to get a fixed number of chars from a line based on a search pattern was given as
but was not able to use for my purpose as I am no expert in unix.Also, the number of chars I want to extract is not fixed.
Thanks in advance,
-dips
Last edited by pludi; 03-09-2010 at 03:32 AM..
Reason: removed links, added code tags
I'm having few question.
i'm have a input file.
Other information
CONNECTIONS
"BP-COLLECTOR"
J6.4
"BP-TEST".4;
+5VS
C34.1
U21.1;
DEV_I2C_SDA
J6.6
R4.1
U18.1;
DEVICES
"BP-TEST"
1."BP-LED_ANODE" (8 Replies)
Is there a single Command in Unix to get the following Information when searching for files containing one or more strings in a Unix Directory (including sub directories within it) :
1) Complete filename ( path and filename)
2) Owner of the file
3) Size of the file
4) Last Modified date... (3 Replies)
I'm not too fluent at this and having problems comprehending / coming up with a way to do it. Our telephone system is spitting out call information on it's maintenance (serial) port which i have connected to a linux box. I want to be able to monitor the output of this text and when a 911 call is... (1 Reply)
Hi
I can't get this line to work. I need to capture what is between Home and plugin_out, where the .* is located.
RUN=`echo '${TSP_FILEPATH_PLUGIN_DIR}' | sed -e 's^/results/analysis/output/Home/\(.*\)/plugin_out/g'`;
echo ${RUN};
I'm getting the error
sed: -e expression #1, char 51:... (1 Reply)
Hello,
I need to get the lv mountpoint from the hdisk directly (from vgda i guess) and not from odm or /etc/filesystems
I knew the command, but unfortunately I forgot it ;)
cheers funksen (5 Replies)
Hi Experts,
I am writing a shell script (for displaying disk space details) which is logging to 15 different servers using following command.
ssh userid@servername
It is prompting me for password for all 15 servers when I manually run it.
However , soon I would like to schedule this script... (4 Replies)
I am a newbie and would like some help with the following -
Trying to search fileA for a string similar to -
AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3
I then want to replace that string with a string from fileB - ... (5 Replies)
Friends,
I want to read BGP session information with C ( in FreeBSD ). The program will almost work like a sniffer. My FreeBSD box (which is not a BGP speaker) will look at BGP session information (after catching and parsing it) and take a decision based on the information it sees. :wall:
... (1 Reply)
Hello All,
Got a question to make a script what reads a directory and put the file names from that directory in a file with some extra text.
ls /tempdir
output is:
file1.gfh
file2.txt
file4.zzz
these file names (always with an extention) must be placed in a line and written to... (2 Replies)
Hi,
I have a name.txt which is stored:
APPLE
ORANGE
RED
BLUE
GREEN
and my script is:
$name=`cat name.txt
for file_number in `ls 1 /appl/CH_DATA/archive/CACHE/CDBACKUP$name*.archived
however, my script cannot read name.txt and put into my scrip line, I would like the output is to... (18 Replies)