Sponsored Content
Top Forums Shell Programming and Scripting Need script to compare and redirect Post 302759151 by Chubler_XL on Monday 21st of January 2013 03:42:15 PM
Old 01-21-2013
What shell are you using?

This seem to work fine in my tests with bash and ksh:

Code:
$ cat sol_servers_global 
server1
server2
server3
 
$ while read server
do
    echo Server $server read
done < sol_servers_global | grep -v global
Server server1 read
Server server2 read
Server server3 read

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search--Compare--Redirect

Hai Guru's, I have 3 files.A,B,C The file A,B is very huge.What i need to do is...I just get each record from file A and compare with File B...if the record presents...redirect the record to File C..otherwise not needed... Kindly give me ur valuable suggestions to resolve the above... (1 Reply)
Discussion started by: satheesh_color
1 Replies

2. Shell Programming and Scripting

How redirect script output from inside of script?

Is it possible to redirect a script output by command inside of that script? I mean, if I have a script 'dosome.sh' I could run it by >dosome.sh > dosome.log I would dream to get some command inside of scrip to do the same; so, running the dosome.sh would have all output redirected to a log... (4 Replies)
Discussion started by: alex_5161
4 Replies

3. Shell Programming and Scripting

compare and redirect to new file

hi i have two file a.txt 123,b,c,d,e 111,c,d,e,f, 456,a,k,j,h b.txt 123 678 987 321 456 i want to compare these two files(match content of b first coloum with a ) and o/p should be like 123,d,e 456,j,h pls help.....:) (7 Replies)
Discussion started by: anish19
7 Replies

4. Shell Programming and Scripting

Redirect bg process output to within the script

Hi, I have a process running in the background, which throws up some output to the terminal when I run my script. How can I read this output from my script? Thank you. (5 Replies)
Discussion started by: Theju
5 Replies

5. UNIX for Advanced & Expert Users

Redirect ErrorLog to a script

Hello, guys! I need to redirect the error_log of apache web server to a script. I tried to use a pipe instead of a filename but this will cause me some troubles beacause cPanel doesn't like it. So, I would like to try something else. Do you have any ideea on how can I read the content of the... (2 Replies)
Discussion started by: Sergiu-IT
2 Replies

6. Shell Programming and Scripting

Cannot redirect to STDIN in a shell script

I am unable to use STDIn redirection with < (commands) When I do the following, both approaches work and give the same results: 1. $ printf "aaa\nbbb\n" > file1 $ printf "111\n222\n" > file2 $ cat file1 file2 aaa bbb 111 2222. $ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") aaa... (8 Replies)
Discussion started by: metaltree
8 Replies

7. Shell Programming and Scripting

Redirect the output in shell script for tftp

I've been using tftp in one of my file #!/bin/bash filename1="config1h.txt" filename2="config15.txt" hostname="test.com" tftp $hostname <</dev/null get $filename1 get $filename2 quit EOF My output looks like this # ./test3.sh tftp> Received 1262 bytes in 0.0 seconds tftp> Received... (2 Replies)
Discussion started by: LavanyaP
2 Replies

8. Shell Programming and Scripting

PHP Redirect Script

Hello Unix.com, I badly need to get rid of drones that access my website. I'm using a hits php script that logs every ip that visits my index.php. Looks like this: <?php $IP = getenv("REMOTE_ADDR"); $day = date('l jS \of F Y h:i:s A'); $fout = fopen("hits.txt", "a"); fputs($fout,... (0 Replies)
Discussion started by: galford
0 Replies

9. Shell Programming and Scripting

Script to call a menu script and redirect each option to a text file

Hello, I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file. For example;- In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies

10. Shell Programming and Scripting

How to redirect the messages from the script to console in Linux?

msg.sh #!/bin/bash if then echo "starting service" else echo " service not started" echo " Please check the start.sh file or manuly start the service" fi if i login with root credentials @12.36.34.123 with passwd username:root passwd:abc once i login into linux pc... (6 Replies)
Discussion started by: saku
6 Replies
Net::Server::MultiType(3)				User Contributed Perl Documentation				 Net::Server::MultiType(3)

NAME
Net::Server::MultiType - Net::Server personality SYNOPSIS
use base qw(Net::Server::MultiType); sub process_request { #...code... } my @types = qw(PreFork Fork Single); Net::Server::MultiType->run(server_type => @types); DESCRIPTION
Please read the pod on Net::Server first. This module is a personality, or extension, or sub class, of the Net::Server module. This personality is intended to allow for easy use of multiple Net::Server personalities. Given a list of server types, Net::Server::MultiType will require one at a time until it finds one that is installed on the system. It then adds that package to its @ISA, thus inheriting the methods of that personality. ARGUMENTS
In addition to the command line arguments of the Net::Server base class, Net::Server::MultiType contains one other configurable parameter. Key Value Default server_type 'server_type' 'Single' server_type May be called many times to build up an array or possible server_types. At execution, Net::Server::MultiType will find the first available one and then inherit the methods of that personality CONFIGURATION FILE
"Net::Server::MultiType" allows for the use of a configuration file to read in server parameters. The format of this conf file is simple key value pairs. Comments and white space are ignored. #-------------- file test.conf -------------- ### multi type info ### try PreFork first, then go to Single server_type PreFork server_type Single ### server information min_servers 20 max_servers 80 spare_servers 10 max_requests 1000 ### user and group to become user somebody group everybody ### logging ? log_file /var/log/server.log log_level 3 pid_file /tmp/server.pid ### access control allow .+.(net|com) allow domain.com deny a.+ ### background the process? background 1 ### ports to bind host 127.0.0.1 port localhost:20204 port 20205 ### reverse lookups ? # reverse_lookups on #-------------- file test.conf -------------- PROCESS FLOW
See Net::Server HOOKS
There are no additional hooks in Net::Server::MultiType. TO DO
See Net::Server AUTHOR
Paul T. Seamons paul@seamons.com SEE ALSO
Please see also Net::Server::Fork, Net::Server::INET, Net::Server::PreFork, Net::Server::MultiType, Net::Server::Single perl v5.16.2 2012-06-05 Net::Server::MultiType(3)
All times are GMT -4. The time now is 12:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy