Hello all,
Need some help here ..
country=(argentina brazil china)
for (( i=0; i < ${#country[i]}; i++ )); do
for init in $(cat ~/files/zones.txt); do
echo ${country[i]} `cat ~/lists/$init.zone| wc -l`
done
done
#desired output
argentina 2000
brazil 400
china 5000
#wrong output I...
Each item in the list is an associated array. I'm trying to traverse each key/value from each associated array. Error message I get ... ${!$x[@]}: bad substitution
I tried substituting with backticks and quotations ..
aaList=( aa1 aa2 aa3 )
for x in "${aaList[@]}"
do
for KEY in...
I'm trying to create a loop or I believe in this case nested for loops but the logic escapes me.
Can someone please assist here? My logic looks way off here ..
for ip in $(cat $ZONES_PATH/br.zone ); do ipset -A brazil $ip; done
for ip in $(cat $ZONES_PATH/cn.zone ); do ipset -A china $ip; done...
I have 2 arrays and I want to compare and only print the non-valid macs in red/bold. The valid macs array will always be constant. I tried comparing 1 element at a time but doesn't work as it would still pick up valid array elements. Any help would be appreciated.
valid macs
90:40:95:29:C4:81...
I'm trying to massage code so that if it finds any ip address(except 0.0.0.0) in the foreign address column it will print out "foreign address found"
right now, it is printing "foreign address found" due to $5 being a column ..
the default ip in column $5 is 0.0.0.0:*
if there is an easier...
Hello everyone,
I’m curious to know if my code is working as designed? The first hourly.0 performs a full backup then every snapshot after (hourly.1 —> hourly.11 afterwards is hardlinked. Now here is the part I’m confused. During one of the runs, I’ll get a full backup performed again on...
Hello,
I can't seem to get my regex right to print out bot the .xml and .zip file. I've been working on this for hours. Can someone please assist this old timer. Thanks in advance. Doing this on a mac os x system if that matters any.
find . -regex "./DC18B[0-9]*\(.zip|.xml\)" -print
find ...
Struggling here to get both IPs in my arr1 to be blocked going to the URLs listed in arr2 In the future, I'd like to expand arr1 to add more IPs if needed.
Can someone please assist with my code below? Thanks in advance.
#!/bin/sh
arr1="192.168.1.12 192.168.1.14"
arr2="facebook.com...
need help with my regex, it is only matching the first line. I need it to match all the entries below.
regex
-----
/bsordertrack\s*[Cannot update assessment event for cannot find Pearson Order Removed empty].*\n|[PEARSON0109]/
matching text
-------------
bsordertrack cannot find Pearson...
for ((i = 1; i <= 9; i=)); do
VAR=`sudo launchctl list | grep ${List[i-1]}` >/dev/null 2>&1
if [ "$VAR = "" ]; then
${List2[i-1]} = List[i-1] <---- the error says =: command not found ..what is wrong with my syntax
echo "${List2[i-1]}"
fi
done
This function is supposed to receive a variable $CON and start a service. I tested it and so I know the function is processing the $CON variable however, when I check the service, it was still down. If run the last line in the function by itself in commandline, it starts the service fine. Do I...
i get a syntax error..end of file error.. where is the error
in my case statment? thanks
case "$CON" in
[Ee][1])
funct1 $CON
;;
[Dd][1])
funct2 $CON
;;
*)
echo " Error: Invalid argument..."...
I'm calling my script like this: ./processName wws2
below is my syntax, how can I use the argument I'm passing to this command below..doesn't seem to like it being passed in as a parameter? There is a syntax error? Please assist. Thanks!
VAR=`ps -ef | grep apdel | awk '/$1/ {print $10}' | cut...
Here is a snippet of my bash code ..can't seem to figure out the error I get; however, if I comment out the first 2 if statements ..it runs fine ..the error I get is "syntax error: unexpected end of file", points the last line
if [[ $# -eq 0 || $# -gt 1 ]] && usage
if [[ $1 != "process1" || $1...
Here is a snippet of my awk statement..I'm trying to insert these 2 variables in the statement but they are not getting evaluated. Can someone point me in the right direction?
ZONE=`date "+%Z %Y"`
DAY=`date "+%a"`
awk '{if (NR<2) {print "["$1, $2, $3"]"}}'
I'v tried this:
awk '{if (NR<2)...
Hey guys,
Can you please help me solve this problem. These statements run fine on their own but I'd like to combine them into one. I can't seem to get it to work. Any guidance would be great.
Thanks!
# First statement
egrep -w 'Deny TCP|Deny UDP' $FW_LOG | awk '{print $1 " " $2 " " $3}' >>...
Hey Everyone,
ORIGINAL="Library/Internet Plug-Ins"
COPY="/MyStuff/watch/Internet Plug-Ins"
The ORGININAL directory has extra files there so when I run the
command below, I'd expect it the find the differences between the 2
variables but it doesn't. Any help is appreciated. I'm thinking, it is...
Hey guys,
Can't find the error in my nested if/else. Please help.
error I get is -
line 56: syntax error near unexpected token `then'
line 56: `else [ "$LOCATION" = "HomeFi" ]; then'
LOCATION=$(networksetup -getcurrentlocation)
if [ "$LOCATION" = "Rental" ]; then
host google.com...
(uuencode ~/LogSize.txt ~LogSize.html ; uuencode ~/Services.txt ~Services.html ; uuencode ~Denies.txt ~Denies.html ; eval echo $SIGNATURE) | mail -s "$SUBJECT" $MAILTO
Can't seem to append a signature to the body of the email. Any ideas? The attachments get sent fine but without signature. Help...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.