I am currently running 2 scripts to gather data for a 3rd script and would like to combine the 2 scripts into one. Having issues with the final output format.
Note cannot post URL so replaced the http stuff with (name) in the examples
All scripts contain #!/bin/ksh OS = Red Hat Enterprise 5.x, and comments left out for simplicity
Objective: 1) find all sub-directories in a path that contain a specific file
a. Keep that path where the file was found
Script 1:
Objective : 2) Using the FileLocation.dat list grep for a string replace the string and print both "OldString NewString" adding commands. print to new script file to be executed later.
Script 2:
Script 2 is piped to cat > relocate.dat
relocate.dat looks like this for each location
cd /path/to/file/location svn relocate
(name)svnFoo.abc/UnwantedinPath/repopath
(name)svnBar.abc/repopath
Objective : 3 What I need is for relocate.dat ( to be used as relocate.sh )
to be formatted as two lines: (both URLs on same line)
thus creating the 3rd script that is the primary script to be executed to do a batch relocate ( will be executed on a Windows Server as a bat file )
Added this to sort out duplicates
Nice to have is the reverse for backout just exchange Foo and Bar path
Last edited by Franklin52; 02-20-2012 at 04:44 AM..
Reason: Please use code tags for code and data samples, thank you
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Hi
I have a bash script which takes parameters
sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC
gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash
I have... (0 Replies)
Hey there, first post, somewhat-long-time lurker-
This is on a Red Hat box
Im working on a new site, and I have an idea for a dynamic CGI script to change who is "on call"
Pretty much, it would pull next name from a text file each week to display it on the site, and just keeps cycling through... (3 Replies)
Hi all,
I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns.
We intend to have a manually updateable SuperSetCols.csv which would look like
"ColA","ColB","ColC","ColD","ColE","ColF","ColG"
so someday we may add... (3 Replies)
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ?
I've given portion of the script here to explain the problem.
Portion of Script 1
=============
-----
-----
tmp=`a.ksh p1 p2 p3`
if then
# error processing
fi
-----... (10 Replies)
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Ih all,
i have multiples ksh scripts for crontab's unix jobs
they all have same variables declarations and some similar functions
i would have a only single script file to declare my variables, like:
var1= "aaa"
var2= "bbb"
var3= "ccc"
...
function ab { ...}
function bc { ... }... (2 Replies)
I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below......
vi hairy
bear=`grep bear animals`
if
then
ksh more_animals
fi
If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is... (1 Reply)
I am using awk in my .ksh script but when I am trying to run in windows
its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like.
thanx.
#!/bin/ksh
egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)