10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a small part of a project which is done as a bash script. bash was selected as an portability issue that works out of the box. In this script I have an exec shell-function, a wrapper around arbitrary commands. I want to have STDOUT, as an addon STDERR and the EXIT-CODE of a specified... (5 Replies)
Discussion started by: stomp
5 Replies
2. Shell Programming and Scripting
Hi
I am pretty confused in returning and capturing multiple values
i have defined a function which should return values "total, difference"
i have used as
#!/usr/bin/ksh
calc()
{
total=$1+$2
echo "$total"
diff=$2-$1
echo "$diff"
}
I have invoked this function as
calc 5 8
Now i... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
3. Shell Programming and Scripting
I'm having trouble with a simple piece of code.
IFS=,
echo "1,2,3,4,5,6,7,8" | while read x y
do
echo "x=$x"
echo "y=$y"
done
I'm hoping for
x=1
y=2
x=3
y=4
.
.
.
but I'm getting
x=1 (3 Replies)
Discussion started by: sabbata
3 Replies
4. Shell Programming and Scripting
Hi,
I have a variable which stores file names as a result of find command. I need to delete all these files one by one, i.e. by a loop. Can anyone tell me how can it be done?
The variable f2d has the file names like these
abc.txt
bcd.txt
fff.txt
gef.txt
Now I have used a loop as... (12 Replies)
Discussion started by: jhilmil
12 Replies
5. Shell Programming and Scripting
use strict;
use warnings;
open (my $fhConditions, "<input1.txt"); #open input file1
open (my $fhConditions1, "<input2.txt");#open input file2
open (my $w1, ">output1");
open (my $w2, ">output2");
our $l = 10;#set a length to be searched for match
our $site="AAGCTT";#pattern to be matched... (1 Reply)
Discussion started by: anurupa777
1 Replies
6. Shell Programming and Scripting
hello friends,
i have written one perl script.Which opens a file and search for some parameter's value and gets the status of these parameters. but while i am trying to return these value always i am getting false. Can any one please help me..
here is that function:
=======================... (5 Replies)
Discussion started by: harpal singh
5 Replies
7. Shell Programming and Scripting
Hello Guys,
I have a small loop problem as below.
I have 3 different values to be used while running the same script -
va1="some-value1"
va2="some-value2"
va3="some-value3"
Now I want to use these three variable values to be used for running the same command, like -
while... (1 Reply)
Discussion started by: rockf1bull
1 Replies
8. Shell Programming and Scripting
Hi,
I need to retrun multiple values
function errorFileCreation
{
echo "Before"
return -1 "Siva";
echo "Aftyer"
}
echo ${?} - This can be used to getting first value.
how can i get second one.
Advance Thanks...
Shiv (3 Replies)
Discussion started by: rsivasan
3 Replies
9. Shell Programming and Scripting
Hi,
I have a script which does something like the below:
execute_some_script.sh $arg1 $arg2 `exec-some-cmd`
if then;
do something
else
do something else
fi
However, during some cases, there is an error saying:
line xxx: [: too many arguments
at the line number which has... (5 Replies)
Discussion started by: laloo
5 Replies
10. Shell Programming and Scripting
perl 5.6.1:
when i try a "system" command(with if loops for $?), i get this:
child exited with value 1
what is meant by this $? values and what does it meant if it returns 1?.. (0 Replies)
Discussion started by: sekar sundaram
0 Replies