05-08-2012
Inside File 1.txt is a line for input
Inside file File2.txt, is a name of Files ( File A, File B, File C)
Logic is to insert every line File1.txt, into File A, B, C by replacing line 2 . Each of this process will be save into 1 fileoutput.txt (total output 6 files, File A.1, B.1, C.1, A.2, B.2, C.2)
File2.txt contain list of File A,B,C
Last edited by guns; 05-08-2012 at 03:01 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have program that I want to be able to use I guess you would call them functions.... to run muliple little programs or loops with one menu script. How would I do this. Here is some code I am using. Sorry about the formatting....it doesn't paste well.
echo "*****************************... (3 Replies)
Discussion started by: darthur
3 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to write a bash script that will read a list of numbers from a file, then it needs to use netcat to create a socket connection and pass header/request. I need to limit it to 100 connections. So, after the first set of 100 are fineshed, I need to loop and do it again with... (0 Replies)
Discussion started by: willdev
0 Replies
3. Shell Programming and Scripting
I have to to read files simultaneously in two nested loops,but am getting error can anyone do the needful.
useridFile=userIds.txt
fname=kiran.txt
exec<$useridFile
while read line
do
echo "User IDs are..$line"
USER_ID=$line
REMOTE_DIR_LOCATION="/home/test/$USER_ID"
SOURCE_DIR=$USER_ID... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies
4. Shell Programming and Scripting
Hey guys,
I'm kinda a noob at scripting. I am trying to create a script that uses multiple for loops with the lsiutility to monitor disk health on a system.
The script runs, but it will continually echo an infinite number of LogVolumes when there are only 2 per virtual disk on my server. It's... (2 Replies)
Discussion started by: tank126
2 Replies
5. Shell Programming and Scripting
Hi script gurus.
I have need to know how to use for loop with multiple variable.
Basically lets take for example /etc/passwd file has following entries
The above cat command will basically first greps the real users that have email addresses then converts ':' to '+' then using cut... (4 Replies)
Discussion started by: sparcguy
4 Replies
6. Shell Programming and Scripting
Hi,
I am trying to incorporate multiple while loops into an expect script written in ksh shell. This is on a Solaris 10 system. Here is the code:
#!/bin/ksh
EXPECT=/usr/local/bin/expect
exp_internal
i=1
h=0
while ]; do
$EXPECT << DONE
set stty_init raw
... (1 Reply)
Discussion started by: cic
1 Replies
7. Shell Programming and Scripting
Hi Guys-
I'm trying to write a script which takes date as input (mm.yy.dd) and search in the current file. If pattern doesn't exist it will then look in a backup directory and so on.
being a newb i'm unable to loop over to the backup directory. hoping for some ideas, i've highlighted the... (1 Reply)
Discussion started by: Irishboy24
1 Replies
8. Shell Programming and Scripting
I am trying to read a file line by line and then search that line in another file and get a particular column from the second file.
I have written this code.but its not working properly
#!/bin/sh
while read keyword in duplicate.txt
do
echo $keyword
while read line
do
... (7 Replies)
Discussion started by: Prachi Gupta
7 Replies
9. Shell Programming and Scripting
All,
I have set up ssh trust between 3 machines. The aim is to connect from machine-A to B and C and clear the txt files in tmp on all 3 machines. And, I have 3 environments and each environment has 2 hosts. So I should be able to run this script on any environment.
Here is the logic:
I want... (5 Replies)
Discussion started by: pnara2
5 Replies
10. Shell Programming and Scripting
Hello,
I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out.
I am specifically facing issues while running for loops.
I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies
LEARN ABOUT DEBIAN
file::sharedir::par
File::ShareDir::PAR(3pm) User Contributed Perl Documentation File::ShareDir::PAR(3pm)
NAME
File::ShareDir::PAR - File::ShareDir with PAR support
SYNOPSIS
use File::SharedDir::PAR ':ALL';
# exact same interface as the normal File::ShareDir:
# Where are distribution-level shared data files kept
$dir = dist_dir('File-ShareDir');
# Where are module-level shared data files kept
$dir = module_dir('File::ShareDir');
# Find a specific file in our dist/module shared dir
$file = dist_file( 'File-ShareDir', 'file/name.txt');
$file = module_file('File::ShareDir', 'file/name.txt');
# Like module_file, but search up the inheritance tree
$file = class_file( 'Foo::Bar', 'file/name.txt' );
You may choose to install the "File::ShareDir::PAR" functions into "File::ShareDir" so that they become available globally. In that case,
you must do the following before anybody can import functions from "File::ShareDir":
use File::ShareDir::PAR 'global';
WARNING
This module contains highly experimental code. If you want to load modules from ".par" files using PAR and then access their shared
directory using "File::ShareDir", you probably have no choice but to use it. But beware, here be dragons.
DESCRIPTION
"File::ShareDir::PAR" provides the same functionality as File::ShareDir but tries hard to be compatible with PAR packaged applications.
The problem is, that the concept of having a distribution or module specific share directory becomes a little hazy when you're loading
everything from a single file. PAR uses an @INC hook to intercept any attempt to load a module. File::ShareDir uses the directory
structure that is typically found in the directories that are listed in @INC for storing the shared data. In a "PAR" environment, this is
not necessarily possible.
When you call one of the functions that this module provides, it will take care to search in any of the currently loaded ".par" files
before scanning @INC. This is the same order of preference you get for loading modules when PAR is in effect. If the path or file you are
asking for is found in one of the loaded ".par" files, that containing ".par" file is extracted and the path returned will point to the
extracted copy on disk.
Depending on how you're using PAR, the files that are extracted this way are either cleaned up after program termination or cached for
further executions. Either way, you're safe if you use the shared data as read-only data. If you write to it, your changes may be lost
after the program ends.
For any further usage information, including the list of exportable functions, please refer to the documentation of File::ShareDir.
SUPPORT
Bugs should always be submitted via the CPAN bug tracker
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-ShareDir-PAR>
For other issues, contact the PAR mailing list: <par@perl.org>
AUTHOR
Steffen Mueller <smueller@cpan.org>
The code was adapted from Adam Kennedy's work on "File::ShareDir"
SEE ALSO
File::ShareDir, File::HomeDir, Module::Install, Module::Install::Share
COPYRIGHT AND LICENSE
Copyright (c) 2008-2010 Steffen Mueller This program is free software; you can redistribute it and/or modify it under the same terms as
Perl itself.
The portions of code that were copied from "File::ShareDir" are:
Copyright (c) 2005, 2006 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as
Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.10.1 2011-03-08 File::ShareDir::PAR(3pm)