Search Results

Search: Posts Made By: Meeran Rizvi
508
Posted By RudiC
Theres a left parenthesis missing at the start....
Theres a left parenthesis missing at the start. In regexes, | is the "alternation" or "OR" operator, so above reads "match a number consisting of"
[0-9] a single digit ...
1,320
Posted By drl
Hi. The syntax for email addresses is...
Hi.

The syntax for email addresses is complicated. Here's a short perl code that tries to catch most correct addresses:
#!/usr/bin/env perl

# @(#) p1 Demonstrate recognize email...
1,626
Posted By apmcd47
Try thispingfunc () { for (( i=$a; i<=$b; i++...
Try thispingfunc ()
{
for (( i=$a; i<=$b; i++ ))
do
/bin/ping -c 1 $c$i > /dev/null 2>&1 && echo $c$i is pingable || echo no answer from $c$i
done
}
I have changed the count from 4 to 1 on...
3,356
Posted By RudiC
Try also IP1=172.30.36.1 IP2=172.30.36.10 ...
Try also
IP1=172.30.36.1
IP2=172.30.36.10
for ((i=${IP1##*.}; i<=${IP2##*.}; i++)); do echo ping -c4 ${IP1%.*}.$i; done
3,356
Posted By RudiC
Your variable assignment doesn't work that way: ...
Your variable assignment doesn't work that way:
- no space after the = sign
- use "command substitution" $(...) for the pipes

You could use shell's "parameter expansion" (instead of above...
3,167
Posted By RudiC
This is not that easy, as it heavily depends on...
This is not that easy, as it heavily depends on top's configuration, and on the tools that are available on your system (which, by the way, you fail to mention in your request). My best result on my...
6,480
Posted By itkamaraj
array length can be retrieved as ${#array[@]} ...
array length can be retrieved as ${#array[@]}

for (( index=${#array[@]}-1 ; index>=0 ; index-- )) ; do
echo "${array[index]}"
done
1,143
Posted By RudiC
Assuming bash or ksh to be your shell, try ...
Assuming bash or ksh to be your shell, try
str="* * * * *"
for i in 1 2 3 4 5
do echo "$str"
str="${str/\*/ }"
done
* * * * *
* * * *
* * *
* *
*
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 01:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy