( ! ) Warning: Use of undefined constant is_bot - assumed 'is_bot' (this will throw an Error in a future version of PHP) in /home/otrekal/public_html/wp-content/plugins/visitor-analytics/function.php on line 237
Call Stack
#TimeMemoryFunctionLocation
10.0001390992{main}( ).../index.php:0
20.0002392712require( '/home/otrekal/public_html/wp-blog-header.php ).../index.php:17
30.0003407944require_once( '/home/otrekal/public_html/wp-load.php ).../wp-blog-header.php:13
40.0004418920require_once( '/home/otrekal/public_html/wp-config.php ).../wp-load.php:50
50.0009525512require_once( '/home/otrekal/public_html/wp-settings.php ).../wp-config.php:91
60.217740560712include_once( '/home/otrekal/public_html/wp-content/plugins/visitor-analytics/visitor-analytics.php ).../wp-settings.php:428
70.218540686256require( '/home/otrekal/public_html/wp-content/plugins/visitor-analytics/function.php ).../visitor-analytics.php:26

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /home/otrekal/public_html/wp-content/plugins/visitor-analytics/function.php:237) in /home/otrekal/public_html/wp-content/plugins/visitor-analytics/function.php on line 330
Call Stack
#TimeMemoryFunctionLocation
10.0001390992{main}( ).../index.php:0
20.0002392712require( '/home/otrekal/public_html/wp-blog-header.php ).../index.php:17
30.0003407944require_once( '/home/otrekal/public_html/wp-load.php ).../wp-blog-header.php:13
40.0004418920require_once( '/home/otrekal/public_html/wp-config.php ).../wp-load.php:50
50.0009525512require_once( '/home/otrekal/public_html/wp-settings.php ).../wp-config.php:91
60.300552741488do_action( $hook_name = 'init' ).../wp-settings.php:598
70.300552741864WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:476
80.300552741864WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:331
90.359556419152process_record( '' ).../class-wp-hook.php:307
100.359556419152record_db( $commentId = -1 ).../function.php:313
110.359556419216setcookie( $name = 'Vistor_Analytics', $value = '9a60567c0c159b21fc23063b3d97d75f', $expires_or_options = 1980519120, $path = '/' ).../function.php:330
Awk a Sed « www.otrekal.info

Awk a Sed

1. Výpis riadku z /etc/passwd, ktorý obsahuje na začiatku string “roo”

cat /etc/passwd | awk /^roo/

2. Vypíšeme len adresáre z výpisu ls -l

ls -l | awk ‘/^d/ { print $9 }’

3. Vypíšeme celý riadok, ktorý obsahuje adresár:

ls -l | awk ‘/^d/ { print $0 }’

4. Vypíšeme obsah súboru /etc/passwd

awk '{ print $0 } ' /etc/passwd

5. Vypíšeme užívateľské mená z /etc/passwd

awk -F':' '{ print $1 }' /etc/passwd

6. Duplikujeme každý riadok:

awk '{ print } { print } ' /etc/passwd

alebo

awk '{ print ; print } ' /etc/passwd

7. Použijeme BEGIN na vytvorenie premennej a následne ju použijeme v END


awk 'BEGIN { CIARA="---------------"; print CIARA } { print } END { print CIARA }' /etc/passwd

8.Očíslujeme riadky z /etc/passwd

awk -F':' '{ print NR, $1 }' /etc/passwd

 

9. Výpis prvých 15 riadkov z /etc/passwd

awk ‘NR <= 15 { print }’ /etc/passwd

10. Vypíšeme všetkých užívateľov, ktorí maju v /etc/passwd bash

awk -F’:’ ‘$7 == “/bin/bash” ‘ /etc/passwd

11. Spočítame počet riadkov a sčítame čísla v druhom stĺpci

awk  ‘ NR > 0 { sum += $2 }END{ print “Pocet riadkov je”, NR, “a suma druheho stlpca je”,  sum }’ subor

12. Vypíšeme riadky, ktoré obsahujú písmeno R a vypíšeme zo stĺpca 3 od znaku 20 5 znakov, následne ich sčítame

awk ‘/R/ { print substr($3,20,5) }’ | awk ‘BEGIN{SUM=0} {SUM+=$1} END{print SUM}’

 

 

SED:

1. Substitucia slov/znakov:

sed s/day/night/ <old >new

2. Text dame do zatvorky, cisla nie:

 echo abcd1234 | sed 's/[a-z]*/(&)/'

3. Zdvojime cisla cez & co je docasne ulozisko
echo "123 abc" | sed 's/[0-9][0-9]*/& &/'

4. Vymazeme cisla, ostane iba text s malymi pismenami
echo abcd123 | sed 's/\([a-z]*\).*/\1/'

5. Zamenime poradie stringov:

echo "abcd dcba" | sed 's/\([a-z]*\) \([a-z]*\)/\2 \1/'

6. Otocime text odzadu:

echo 123 | sed 's/^\(.\)\(.\)\(.\)/\3\2\1/'

7. Substitucia v jednom kroku viac znakov:
sed -e 's/a/A/' -e 's/b/B/' <old >new

8. Zmenime velke A na male a v riadkoch 1 - 100
sed '1,100 s/A/a/'

9. Vypis prvych 10 riadkov:
sed -n '1,10 p'
sed -n '11,$ !p'
sed '1,10 !d'
sed '11,$ d'

10. Editacia - pridanie riadku pred riadok so slovom "WORD"
#!/bin/sh
sed '
/WORD/ i\
Add this line before every line with WORD
'

11. Editacia - vymena riadku s vyskytom slova WORD za iny
#!/bin/sh
sed '
/WORD/ c\
Replace the current line with the line
'
12. Editacia - pridanie riadku pred, pridanie riadku po a vymena riadku s vyskytom slova WORD
#!/bin/sh
sed '
/WORD/ {
i\
Add this line before
a\
Add this line after
c\
Change the line to this one
}'
WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera