10-23-2007
Which flavour of Unix is it in ..?
The sed command sort of fails to accept the $cod as a variable. Try single quotes as below:
sed "s/CODEVENTID/${cod}/" c.ctl
replace with
sed 's/CODEVENTID/'"${cod}"'/g' c.ctl
works for me in solaris ....
Hope this helps,
Vj
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have a doubt in the way the variables inside a function are treated .
if a function is called from the main script directly, the variables inside them act as global variables.
however if the return value of the function is stored to some other variable in the main script as shown,... (3 Replies)
Discussion started by: prez
3 Replies
2. Shell Programming and Scripting
how to return value from function and print from main program???
And also I need to return true or false... Is it possible? (5 Replies)
Discussion started by: darshakraut
5 Replies
3. Shell Programming and Scripting
I have write a shell function to get the maximum of a vector.
However, the returned value from the function is not always
the correct one.
Here is the script:
maxval()
{
local max j i size arrval
size=$1 ; shift
max=-999999999
i=0
while
do
arrval="$1"
if
then
... (5 Replies)
Discussion started by: fl0r10
5 Replies
4. Shell Programming and Scripting
I am using ksh. I want to know how can we make any function to return string or double value.
I dont want to use the global variables. (5 Replies)
Discussion started by: PRKS
5 Replies
5. Shell Programming and Scripting
I have two scripts. script1.sh looks
--------------------------------
#!/bin/bash
display()
{
echo "Welcome to Unix"
}
display
-----------------------------
Script2.sh
#!/bin/bash
sh script1.sh //simply calling script1.sh
------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies
6. Shell Programming and Scripting
So, in Oracle (11gR2) on aix I have a function like:
CREATE OR REPLACE function COMMON.t2(var1 in varchar2, vari in number,var2 in out number) return number as
begin
insert into korisnik_temp(kor_inicia, kor_opisno) values(1, var1);
var2:=0;
return var2;
exception
when... (12 Replies)
Discussion started by: bongo
12 Replies
7. Shell Programming and Scripting
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
8. Shell Programming and Scripting
Hi All,
Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition.
#Body
function1()
{
if
then
echo "exist"
else
echo "not exist"
}
#if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
LEARN ABOUT REDHAT
pvm_archcode
ARCHCODE(3PVM) PVM Version 3.4 ARCHCODE(3PVM)
NAME
pvm_archcode - Returns the data representation code for a PVM architecture name.
SYNOPSIS
C int cod = pvm_archcode( char *arch )
Fortran call pvmfarchcode( arch, cod )
PARAMETERS
arch Character string containing the architecture name.
cod Integer returning architecture code.
DESCRIPTION
The routine pvm_archcode returns an integer given an architecture name. The code returned identifies machines with compatible binary data
formats. For example, SUN4 and RS6K have the same code, while ALPHA has a different one (because a few datatypes have different sizes).
This lets you know when you can get away with using PvmDataRaw instead of PvmDataDefault encoding to pass messages between tasks on two
machines.
Naturally, you shouldn't assume the values returned by pvm_archcode are etched in stone; the numbers have no intrinsic meaning except that
if two different arch names map to the same value then they're compatible.
This routine is actually obsolete in the sense that the architecture codes returned are already available in the hi_dsig field of the
pvmhostinfo structure returned by pvm_config(), as shown in the below example. The routine is maintained for backwards compatibility only.
EXAMPLES
C:
struct pvmhostinfo *hip;
int i;
pvm_config((int *)0, (int *)0, &hip);
i = pvm_archcode(hip[0].hi_arch);
/* or you could just do: i = hip[0].hi_dsig; */
Fortran:
CALL PVMFARCHCODE( 'RS6K', k )
ERRORS
On success, pvm_archcode returns a positive integer data signature.
The following error conditions can be returned as well:
PvmBadParam
giving an invalid architecture name.
PvmNotFound
there is no host with the given architecture name in the current virtual machine configuration.
PvmSysErr
pvmd not responding.
SEE ALSO
pvm_config(3PVM), pvm_initsend(3PVM), pvm_notify(3PVM), pvm_tasks(3PVM), pvm_tidtohost(3PVM)
15 March, 1994 ARCHCODE(3PVM)