10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am having script which contains many functions. Need to print each function name at the starting of the function. Like below,
functionname()
{
echo "functionname"
commands....
}
I've tried like below,
func=`grep "()" scriptname | cut -d "(" -f1`
for i in $func
do
nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. UNIX for Advanced & Expert Users
Hello Gurus :)
I'm "currently" (for the last ~2weeks) writing a script to build ffmpeg with some features from scratch.
This said, there are quite a few features, libs, to be downloaded, compiled and installed, so figured, writing functions for some default tasks might help.
Specialy since... (3 Replies)
Discussion started by: sea
3 Replies
3. Shell Programming and Scripting
check_deplver ()
{
dir=/abc/def/ghi
if ssh -o StrictHostKeychecking=no $1 "" 2> /dev/null
then
echo " output is "
ssh -o StrictHostKeychecking=no $1 "ls -lrt $dir | grep -i abc" 2> /dev/null
else
echo " directory not presnt"
fi
}
This is not working.
But... (7 Replies)
Discussion started by: NarayanaPrakash
7 Replies
4. Shell Programming and Scripting
I have a script that has to execute a read command in a function, this is in an ash busybox.
The code is...
trapcatch () { echo "Ctl-c Detected, what do you want to do?"
echo "Please choose the number of one of the following options"
echo "1. Jump past this Set"
echo "2. Exit... (8 Replies)
Discussion started by: tesser
8 Replies
5. Programming
I have the following code and want to update shiftDesc inside the function. Is it correct to declare the argument as:
int shiftDesc
void prValue_vd(
FILE* stream, // name of output stream
int shift, // amount of shift to the right
const char* value,... (1 Reply)
Discussion started by: kristinu
1 Replies
6. Shell Programming and Scripting
Hi All
I have searches getopts function in Perl a lot, but yet i didn't cleared with it.
First I want to know what is the meaning of
getopts('t:c:', \%options);
and please explain getopts function in an easy way.. (4 Replies)
Discussion started by: parthmittal2007
4 Replies
7. Shell Programming and Scripting
If I call my function with grouped options: "logm -TDIWEFO 'message' ", then only the "T" gets parsed correctly. The subsequent values returned have underscores prefixed to the value: "_D", "_I", etc. If I "logm -T -DIWEFO 'message' ", the "T" and the "D" are OK, but "I" through "O" get the... (2 Replies)
Discussion started by: kchriste
2 Replies
8. Shell Programming and Scripting
i have a script like this
#!/bin/ksh
initialize()
{
x=20
}
...
...
...
x=10
initialize;
echo $x (2 Replies)
Discussion started by: trichyselva
2 Replies
9. Shell Programming and Scripting
I wrote a script that uses getopts and it works fine. However, I would like to put the function in that script in a startup file (.kshrc or .profile). I took the "main" portion of the script and made it a function in the startup script. I source the startup script but it doesn't seem to parse... (4 Replies)
Discussion started by: lyonsd
4 Replies
10. Shell Programming and Scripting
set -A arr a1 a2 a3 a4
# START
ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS
integer j=0
for loop in ${arr}
do
printf "array - ${arr}\n"
(( j = j + 1 ))
j=`expr j+1`
done
EOS
# END
=========
this is not giving me correct output.
I... (5 Replies)
Discussion started by: reldb
5 Replies