10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello everyone,
I have written simple script below to check if ip is added to interface
#!/usr/local/bin/bash
IFCONFIG="/sbin/ifconfig"
SERVICE="/usr/sbin/service"
IP="79.137.X.X"
GREP=$(${IFCONFIG} | grep ${IP})
ip_quantity_check () {
echo ${GREP} | wc -l
}
if ];... (2 Replies)
Discussion started by: bryn1u
2 Replies
2. Shell Programming and Scripting
All,
I have a basic buzz program written in python with return function. If i change return with print,it works fine but i want to know whats wrong with return statement.Can anyone help me whats wrong with this
#!/usr/bin/python
def div4and6(s,e):
for i in range(s,e+1):
if... (5 Replies)
Discussion started by: oky
5 Replies
3. Shell Programming and Scripting
Hi ! all I am just trying to check range in my datafile
pls tell me why its resulting wrong
admin@IEEE:~/Desktop$ cat test.txt
0 28.4
5 28.4
10 28.4
15 28.5
20 28.5
25 28.6
30 28.6
35 28.7
40 28.7
45 28.7
50 28.8
55 28.8
60 28.8
65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
4. Shell Programming and Scripting
I have to make a log function which will take any statement and write it to a file along with the time stamp.Right now I have the following code:
log()
{
echo "`date` `hostname`: $1" >> logfile
}
echo "Some statement."
log "Some statement."
This way I can see "Some... (7 Replies)
Discussion started by: chacko193
7 Replies
5. Shell Programming and Scripting
Need your assistance, to find the bug in the function.
Function usage erroring out even after passing parameters.
usage() {
if || ; then
echo "************************************************************"
echo " CHECK USAGE FOR CORRECT PARAMETERS ... (26 Replies)
Discussion started by: raghunsi
26 Replies
6. Shell Programming and Scripting
Hi
I have a small function which returns a wrong value.
The function tries to make a connection to oracle database and tries to get the open_mode of the database in the variable status.
However when a database is down the value of the status column is set to READWRITE i am not sure why.
I... (0 Replies)
Discussion started by: xiamin
0 Replies
7. Programming
Hi,
I have two dynamically loaded libraries (shared objects), both of which include functions of the same name - foo. When I call 'foo' from libA, it takes it from libB, although it is implemented in libA as well. Since we need the function to be called from libA, we tried linking it with the... (1 Reply)
Discussion started by: rimon
1 Replies
8. Shell Programming and Scripting
Hi,
I am getting some very strange output when using date function in PERL on Solaris.
Infact the month portion is wrong and it is 1 less then the current, means today it is responding as
month =3 , andthis should be 4 ------> April
Any help
my code is
($day, $month, $year) =... (3 Replies)
Discussion started by: Asteroid
3 Replies
9. Shell Programming and Scripting
How do i write a code to convert watt to dBm and vice versa?
1o log(w) + 30 = dBm
Thanks! (17 Replies)
Discussion started by: Ernst
17 Replies
10. Shell Programming and Scripting
First of all im using Bash, on a Debian-based machine. I tried to write a function that if the ls program found listed more than 25 lines I would automaticly use "ls | less". Its on another computer but if I recall it looked something like this...
Note: some code may look strange because im on... (4 Replies)
Discussion started by: riwa
4 Replies