10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to capture system() function output in awk variable and the print that awk variable..... (8 Replies)
Discussion started by: bharat1211
8 Replies
2. Shell Programming and Scripting
Hi,
I would like to have the output from an Oracle procedure be captured into a bash variable, then emailed to me when it runs on the cron daily as such:
~~~~~bash script~~~~~~~~~~~
#!/bin/bash
shellvar=`sqlplus -s <<EOF
execute test();
commit;
exit;
EOF`
echo $shellvar
mail -s "email... (1 Reply)
Discussion started by: inlinesidekick
1 Replies
3. Shell Programming and Scripting
Hi
I have a shell script that does a whole bunch of things. For the sake of simplicity, assume it runs commands one two and three. What i ultimately need is the ability to display the output of the entire script on the screen as well as capture the output in a file. When I try to do it in the... (3 Replies)
Discussion started by: rch
3 Replies
4. Shell Programming and Scripting
Hi all,
I'm trying to implement a linear congruential pseudorandom number generator (<http://en.wikipedia.org/wiki/Linear_congruential_generator>), since $RANDOM and /dev/random aren't standardized. I'm referring to the Shell & Utilities volume of POSIX.1-2008, but I'm running into some odd... (3 Replies)
Discussion started by: PehJota
3 Replies
5. Shell Programming and Scripting
Dear Forum
I'm Trying to use split function to split a string, but the output is not as the same order as of the string, please see simple example
echo " " | nawk -v var="First;Second;Third;Fourth" '
BEGIN {split(var, arr,";") for(i in arr){print arr }}'
The output is
Second
Third... (6 Replies)
Discussion started by: yahyaaa
6 Replies
6. Shell Programming and Scripting
Hi, I have this code:
#Convert epoch2date
getdate()
{
perl -e '
use POSIX qw(strftime);
$mydate = strftime "%c", localtime($ARGV);
print $mydate; ' $1
}
lsuser -a time_last_login gecos $username |awk '{print $1,$2,$3,$4}'|sed -e 's/gecos=/ Nombre: /' -e 's/time... (2 Replies)
Discussion started by: iga3725
2 Replies
7. Shell Programming and Scripting
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
Discussion started by: boy18nj
5 Replies
8. Shell Programming and Scripting
Hello All,
I am new to Shell script world. Please help me out with following query..
OS: AIX
Shell Script I am trying to execute:
showStatus ()
{
echo $1
//Actually I need to do something with the input here...
}
./serverStatus.sh | grep STARTED | awk '{print $5}' | showStatus... (3 Replies)
Discussion started by: raj_uk
3 Replies
9. Shell Programming and Scripting
Hi all,
how i can get an calculated value from a function
for exemple
my function is like
function getMyPseudo {
..
..
echo "Rambler"
}
i need to put the printed string into a variable
sommeting like :
MYPSEUDO=getMyPseudo
print $MYPSEUDO
in that case, the out put i... (3 Replies)
Discussion started by: rambler
3 Replies
10. UNIX for Dummies Questions & Answers
I have this shell:
function AAAA {
echo $* > Log1
}
# main
AAA "TEST" > Log2
.....
I not see the same output in the 2 files ; only Log1 result with the strings $*
Log2 is without strings ....
Why? (1 Reply)
Discussion started by: ZINGARO
1 Replies