10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team -
I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n?
%~n is a DOS variable that dispayed the script name.
For instance (in DOS):
REM... (11 Replies)
Discussion started by: SIMMS7400
11 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
I have a script which does gunzip, zip and untar.
Input to the script is file name and file directory (where file is located)
I am reading the input parameters as follows:
FILENAME=$1
FILEDIR=$2
I have created 3 functions that are as follows:
1) gunzip file
2) unzip file... (2 Replies)
Discussion started by: pinnacle
2 Replies
4. 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
5. 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
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. Shell Programming and Scripting
I am working on a script that will recycle processes in an application identified by entry ids. I am reading a file, and using the first field in the records in file to store the entry ids. The second field is a description. I have two records in this file to test my script.
My code to do this... (2 Replies)
Discussion started by: Skyybugg
2 Replies