10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello
I would to write the test on one line like :
declare -i x=0 y=0
........
some code assign value 0 or 1 to x and y
........
# if either x or y or both is set to 1, then do something
if -o ; then
do_something
fi
Any help is welcome (2 Replies)
Discussion started by: jcdole
2 Replies
2. Shell Programming and Scripting
Hi,
Im trying to write a Bash script that calculates the least common subnet for two address.
Theoretical: I have to change IP from decimal to binary, then apply XNOR on the two IPs.
I tried to write this:
#!/bin/bash
echo "Ebter the first ip"
read ip1
echo "Enter the second ip"
read... (7 Replies)
Discussion started by: Miron
7 Replies
3. Shell Programming and Scripting
hi, im learning python language. and my teacher gives me this question on class:
Boolean expression :
not (p or not q)
what is the correct answer for that? i still dont understand, and please give me a link for a new beginner in python to learn.
thanks (1 Reply)
Discussion started by: jazzyzha
1 Replies
4. Shell Programming and Scripting
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi (1 Reply)
Discussion started by: kevin298
1 Replies
5. UNIX for Dummies Questions & Answers
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi
espeacailly the top regex part?
---------- Post updated at 06:58 PM ---------- Previous update was... (1 Reply)
Discussion started by: kevin298
1 Replies
6. Shell Programming and Scripting
Hi everybody:
I'm working on a script to send emails with logs attached based on one single rule..."check if the number of errors has increased since the last time the script ran"
Basically what my script does is read from a previous file with the last trace of errors the previous error... (3 Replies)
Discussion started by: hyunkel_01
3 Replies
7. Shell Programming and Scripting
hi,
I have written a script to search MAC address in a given directory.
MAC address would be in format XX.XX.XX.XX.
The digits contain hexadecimal numbers.
For this i have used grep as follows.
grep -rn '^\{1,2\}\.\{1,2\}\.\{1,2\}\.\{1,2\}\$' *
This is not working as required.... (17 Replies)
Discussion started by: flamingo_l
17 Replies
8. Shell Programming and Scripting
Hello all,
I would like to know if it is possible to return a the result of a boolean expression from a function like this
function()
{
# some code
return ||
}
and what will be the return value ?
Thank you for help. (6 Replies)
Discussion started by: dolphin06
6 Replies
9. Shell Programming and Scripting
How can I find out, that whether a regular expression are matched or not(as a boolean)?!
tnx in advance. (2 Replies)
Discussion started by: Zaxon
2 Replies
10. Shell Programming and Scripting
Hi,
Actually i have written one test.sh (shell program) in bash.
Here i have a variables $a which stored the value package1.
Now I want to write a regular expression inside the if command that "if $a variable contains letter p in the begining of the value package1 then it is coming true.... (5 Replies)
Discussion started by: sunitachoudhury
5 Replies