11-06-2008
You can create a variable. Then add 1 to the variable and make that part of the output name.
For example
sh-3.2$ count=0
sh-3.2$ for i in `ls file*`
> do
> count=$(($count + 1))
> cat $i > "newfile${count}"
> done
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i am passing around 14 parameters for a script
a=$1
b=$2
c=$3
d=$4
e=$5
f=$6
g=$7
h=$8
i=\"${9}\"
shift
j=\"${1}\"
still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
Discussion started by: dnat
2 Replies
2. Shell Programming and Scripting
Hi All,
My target is to find the list of orphan processes running and i issue the below command with some exception ids.
ps -ef | egrep -v "root|system|admin" | awk '{if ($3 == 1) print $1",\t"$2",\t"$3}'
but this will exclude the process having the word 'root' and executing under different... (1 Reply)
Discussion started by: Arunprasad
1 Replies
3. Shell Programming and Scripting
I am writing a script that should read the csv file and pass the values in the file as parameters
to the script. The csv file looks like this:
TEST_1,20110221
TEST_2,20110220
TEST_3,20110218,20110219
Currently this is how i am running the script
./test.sh <param1> <date>
Ex: ./test.sh... (6 Replies)
Discussion started by: stunnerz_84
6 Replies
4. Shell Programming and Scripting
Hi All,
I am new to shell scripting required some help in passing the parameter value to the shell script.
I am writing a shell script, in the script I have created two functions as below.
first function
get_trend_ids () {
Here I am connecting to the database and getting all the... (3 Replies)
Discussion started by: shruthidwh
3 Replies
5. Shell Programming and Scripting
how can i make a script to run only when parameters are given,
if parameters are not given it should through an error , saying "please enter a parameter"
for ex: i want a find command to run only when the parameters are given (4 Replies)
Discussion started by: knip
4 Replies
6. Shell Programming and Scripting
Hi all,
I have a load of files in the format e.g.
a_1.out
a_300.out
a_20.out
etc
I would like to numeric sort them in ascending order by the number in the file name,
then pass them into awk for manipulation. How do I do this? (8 Replies)
Discussion started by: jimjam
8 Replies
7. Shell Programming and Scripting
we are using following script to execute stored procedue. The problem is run_pmcmd.ksh script is using $*
parameter which is not taking in account 'Men Shirt' parameter which includes spaces.
1. Step 1
run_pmcmd.ksh CONVERT_TEST
script for run_pmcmd.ksh
/u01/$(whoami)/run_pmcmd.ksh... (11 Replies)
Discussion started by: sandy162
11 Replies
8. Shell Programming and Scripting
I have a script that uses more than one parameter. It looks like this:
for i in `cat /tmp/listofpolicies`;
do
for x in $(cat /tmp/lst |sed 's/^/\/usr\/openv\/netbackup\/db\/class\//g');
do /usr/openv/netbackup/bin/admincmd/bpplinclude $i -delete -f $x;done;done
The problem is that the... (3 Replies)
Discussion started by: newbie2010
3 Replies
9. Shell Programming and Scripting
Hi,
I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code)
#!/bin/bash
awk -F "," 'BEGIN {
...
...
...
}' file1 file2 file3
In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies
10. Shell Programming and Scripting
Hi,
I am a beginner in python programming. In my python script have a main function which calls several other functions. The main function gets its input by reading lines from a input text file. I call the main function for every line in input text file through a loop.
def main(line):
var1... (6 Replies)
Discussion started by: ctrld
6 Replies
LEARN ABOUT DEBIAN
tau_context_event
TAU_CONTEXT_EVENT(3) TAU Instrumentation API TAU_CONTEXT_EVENT(3)
NAME
TAU_CONTEXT_EVENT - Triggers a context event
SYNOPSIS
C/C++:
TAU_CONTEXT_EVENT(TauUserEvent variable, double value);
Fortran:
TAU_CONTEXT_EVENT(integer variable(2), real value);
DESCRIPTION
Triggers a context event. A context event associates the name with the list of routines along the callstack. A context event tracks
information like a user defined event and TAU records the maxima, minima, mean, std. deviation and the number of samples for each context
event. A context event helps distinguish the data supplied by the user based on the location where an event occurs and the sequence of
actions (routine/timer invocations) that preceeded the event. The depth of the the callstack embedded in the context event's name is
specified by the user in the environment variable TAU_CALLPATH_DEPTH. If this variable is not specified, TAU uses a default depth of 2.
EXAMPLE
C/C++ :
int f2(void)
{
static int count = 0;
count ++;
TAU_PROFILE("f2()", "(sleeps 2 sec, calls f3)", TAU_USER);
TAU_REGISTER_CONTEXT_EVENT(event, "Iteration count");
/*
if (count == 2)
TAU_DISABLE_CONTEXT_EVENT(event);
*/
printf("Inside f2: sleeps 2 sec, calls f3
");
TAU_CONTEXT_EVENT(event, 232+count);
sleep(2);
f3();
return 0;
}
Fortran :
integer memevent(2) / 0, 0 /
save memevent
call TAU_REGISTER_CONTEXT_EVENT(memevent, "STORAGEARY mem allocated')
call TAU_CONTEXT_EVENT(memevent, SIZEOF(STORAGEARY)*sizeof(INTEGER))
SEE ALSO
TAU_REGISTER_CONTEXT_EVENT(3)
08/31/2005 TAU_CONTEXT_EVENT(3)