Search Results

Search: Posts Made By: batchenr
2,206
Posted By batchenr
For i in loops on 2 arrays
Hey ,

i have this script and i have these loops so it can find a match between 2 arrays :


ARRAY_1=(one two three)
ARRAY_2=(A B C)
VAR='B'

for NUMBERS in "${ARRAY_1[@]}"
do
...
964
Posted By batchenr
Hey, LOG is simply a file /tmp/zabbix.csv that...
Hey,
LOG is simply a file /tmp/zabbix.csv that after the script i can atteched to email

continue acts like that -
if there is a time out on some IP it does no continue all the loop with this ip...
964
Posted By batchenr
Add new line after 'continue' in if statment
Hello,

im creating a csv file for email reporting on issues.
my problem is that after 'continue' command in if statment in a loop
the new paramter writing into the log doesnt take new line.

...
1,157
Posted By batchenr
Hey, my attemps were with sed sed...
Hey,

my attemps were with sed
sed 's/origline/changedline/g'

but its not what im looking for,
the only thing i can maybe do is a while read line
and give every line a number. but i tought...
1,157
Posted By batchenr
Replace line for another line in file
Hey,

i have been struggeling to find the answer myself so this is the best forum
has alwyas help me :)

i have an API that get data from a provider via curl.
the data comes like this :
...
2,750
Posted By batchenr
Thank you! i was able to do it like this : ...
Thank you!

i was able to do it like this :
SIP_ACCOUNT_ID=(ohXlWOHKzX8wPSA9SJ e8s-XPBeAgFGel2T3Izt)

declare -A names=([ohXlWOHKzX8wPSA9SJ ]=server2.pbx [e8s-XPBeAgFGel2T3Izt]=server1.pbx)
...
2,750
Posted By batchenr
thanks for the replay but i dont think its it. ...
thanks for the replay but i dont think its it.
i do belive it should be with dictionary.

doing this is too specific with the key1 key2

declare -A array_name

array_name["Key1"]="Value1"...
2,750
Posted By batchenr
Bash Array connectin to another Array
Hello,

i have a script that i need account_number to match a name.
for exsample :

ACCOUNT_ID=(IatHG8DC7mZbdymSoOr11w KbnlG2j-KRQ0-1_Xk356s8)
and i run a loop curl requst with this the issue...
1,975
Posted By batchenr
Bash - make csv file
Hello,

im trying to make csv file from a text file that it is the output of pssh command
(multiple ssh )

now if i run the command date on all of our servers:

i get this output :
[7]...
3,088
Posted By batchenr
Thanks you the array worked and now ur loop also....
Thanks you the array worked and now ur loop also.
btw - the reason i dont compare it to mount -v is cause the system thinks that the nfs is mounted but its not and only throw df i can see it :

...
3,088
Posted By batchenr
i dont want to count on the same order i want it...
i dont want to count on the same order i want it indevidualy to check
every val in Array compare to array2

this is the values:

ARRAY_FILES=$(df -Pk |awk '{print$6}' | grep -v Mounted | xargs)...
2,463
Posted By batchenr
Yes! thanks :)
Yes! thanks :)
2,463
Posted By batchenr
almost :) yours give extra file that i dont...
almost :)
yours give extra file that i dont need - swap

/
/boot
swap
/dev/shm
/var/spool/asterisk/monitor


my output :
/
/boot
/dev/shm
/var/spool/asterisk/monitor
3,088
Posted By batchenr
Array compare bash script
Hello,

i have a script that should compare between ${ARRAY[@]}
that contains all fstab record like this :
>>echo ${ARRAY[@]}
/ /boot

between all mountpoints in my df that is stord in...
2,463
Posted By batchenr
Hey thanks my output file looks like this : ...
Hey thanks
my output file looks like this :

it is fstab
#
# /etc/fstab
# Created by anaconda on Sun Sep 11 13:08:43 2016
#
# Accessible filesystems, by reference, are maintained under...
2,463
Posted By batchenr
it gives me all the # lines and after i need...
it gives me all the # lines and after
i need after # (without showing the #)
only after

thanks you
2,463
Posted By batchenr
Grep after - til the end of the line
Hi,

i need to cat a file after # till the end of the file
usually ill do cat /etc/somthing | grep -A999999 #

but its not that professional
thanks

edit by bakunin: please use CODE-tags (or...
4,706
Posted By batchenr
lol its someone from our team but he didn't think...
lol its someone from our team but he didn't think he had to tell us- no worries
he got some from the boss :)
4,706
Posted By batchenr
Crashing machins at ESXI-6 killed by TERM signal
Hi,

i have 2 machines in ESXI6 that both made a restart at the same time but no errors from ESXI side.

one machine with Centos 6.6 and one with centos 7
same log at the Dmesg:

please help...
2,000
Posted By batchenr
well solved - i turned out like a newbie i put...
well solved - i turned out like a newbie
i put the DEBUG after if statement and since this if didn't kicked in the function didn't work.

thanks sorry :)
2,000
Posted By batchenr
but thats what i did- for some reason inside...
but thats what i did- for some reason inside flock i cant call this function
7,662
Posted By batchenr
can you update your CURL to latest ? yum -...
can you update your CURL to latest ?
yum - Upgrade cURL to latest on CentOS - Server Fault (http://serverfault.com/questions/321321/upgrade-curl-to-latest-on-centos)
2,000
Posted By batchenr
[SOLVED]Flock preventing function to work
Hi i have a script that check pings and i use flock to so the script wont run
multipul times :

its not the whole script but this is the idea :

(
flock -x -w 3 200 || exit 1...
1,265
Posted By batchenr
Bash compere 2 numbers and know the diffrents
Hi,

id like to know how i do this :
if i have 2 different numbers:






so ok bash knows B is bigger then A but i like to know in how much ?
how can i calculate ?

how can i know...
Forum: Red Hat 12-07-2016
2,246
Posted By batchenr
hi, you can try dmesg
hi,

you can try dmesg
Showing results 1 to 25 of 30

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