Search Results

Search: Posts Made By: urello
1,758
Posted By urello
Match output fields agains two patterns
I need to print field and the next one if field matches 'patternA' and also print 'patternB' fields.
echo "some output" | awk '{for(i=1;i<=NF;i++){if($i ~ /patternA/){print $i, $(i+1)}elif($i ~...
1,856
Posted By urello
How newline character "^M" appeared in file?
I have two files. Diff and hexdump tell that they are identical. However vi shows windows newline characters "^M" in one of these files. How is this possible?
7,465
Posted By urello
Xargs: multiple commands to each argument
Hello. There is my one-liner to get subjects of potential spam mails

sudo exiqgrep -bf "spamer@example.com" |cut -d' ' -f1 |xargs -I ~ sudo /usr/sbin/exim -Mvh ~ |grep 'Subject: '
I want to...
1,717
Posted By urello
awk multiple filed separators
There is an usual ifconfig output

vlan30 Link encap:Ethernet HWaddr
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2407:4c00:0:1:aaff::1/64...
11,564
Posted By urello
Passing awk variables to bash variables
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work
4,105
Posted By urello
using ssh with "-f" arg solved my issue.
using ssh with "-f" arg solved my issue.
4,105
Posted By urello
Execute command on remote host via ssh
How should i make the following code working
#!/bin/bash
INPUTFILE="test.txt"
while read STRING; do
IP=`host -t A $STRING | awk '{print $NF}'`
HOSTNAME=`ssh -oPasswordAuthentication=no...
Forum: UNIX and Linux Applications 07-15-2014
3,250
Posted By urello
How to make ldappasswd use {SHA} instead of {SSHA} for users passwords in openldap?
Is it possible to use {SHA} with ldappasswd? I didn't find responsible option in manual page and doc
4,111
Posted By urello
This gave me no uotput at all :(
This gave me no uotput at all :(
4,111
Posted By urello
I'm using...
I'm using preg_match_all('/(dept1.*|dept2.*|dept3.*)/i', $curl_out, $userarray1, REG_SET_ORDER);
$curl_out - is input multiline variable (curl execution)
$userarray1 - is output multiline array
4,111
Posted By urello
I need to use it in php script. Calling awk from...
I need to use it in php script. Calling awk from there sounds not good. Moreover i can split string into array and shift it, but i'd like to know regex-based solution just to extend my regex...
4,111
Posted By urello
PHP - Regex for matching string containing pattern but without pattern itself
The sample file:

dept1: user1,user2,user3
dept2: user4,user5,user6
dept3: user7,user8,user9

I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose...
40,250
Posted By urello
Nice one, Corona! Thx.
Nice one, Corona! Thx.
40,250
Posted By urello
The same [user@freegtw ~]$ cat bashtest ...
The same
[user@freegtw ~]$ cat bashtest
#!/usr/local/bin/bash
cat <<<"EOF"
line1
line2
line3
EOF

[user@freegtw ~]$ ./bashtest
EOF
./bashtest: line 3: line1: command not found
./bashtest:...
40,250
Posted By urello
Echo multi-line string via heredoc syntax
[user@freegtw ~]$ cat bashtest
#!/usr/local/bin/bash
echo <<<"EOF"
line1
line2
line3
EOF

[user@freegtw ~]$ ./bashtest

./bashtest: line 3: line1: command not found
./bashtest: line 4:...
4,120
Posted By urello
Convert posix regex to pcre (perl)
In order to clean file from html tags i used the following
sed 's/<[^>]*>//g' filename
Right now i need to do the same from php script so i have to use pcre. How to convert?
Forum: UNIX and Linux Applications 06-05-2014
3,670
Posted By urello
How to create mailing list in openldap?
Hi.
I want to create mailing list in my directory, however standart object classes groupOfUniqueNames and groupOfNames don't contain mail attribute. What is the common way to create mailing list in...
5,455
Posted By urello
Awk. Abort script if condition was met.
I want to abort script if input variable matched first field in any line of a file.

#!/bin/sh
read INPUTVAR1
awk "{if(\$INPUTVAR1 == $1) x = 1} END {if(x==1) print \"I want to abort script...
20,398
Posted By urello
Sed. Delete line before and after pattern.
Hi.
In need to delete line before and after pattern in file. I came to following commands.
Delete line before
sed -ni '/pattern/{x;d;};1h;1!{x;p;};${x;p;}' /etc/testfile
Delete line after
sed -i...
4,819
Posted By urello
Thanks a lot. It works for me
Thanks a lot. It works for me
4,819
Posted By urello
Match string against character class in bash
Hello,
I want to check whether string has only numeric characters. The following code doesn't work for me
#!/usr/local/bin/bash
if [[ $1 =~ [:digit:] ]]; then
echo "true"
else
echo "False"
fi...
3,136
Posted By urello
Mutual exclusion in getopts
Can i use mutual exclusion of particular args and force script to exit if both are specified?

while getopts l:d: OPTS; do
case $OPTS in
l) VALUE1=$OPTARG;;
d)...
1,538
Posted By urello
Why du and stat are showing different mtime?
[usr027@psr5651 /opt]$ stat qt_tdata_025/dblogs
File: `qt_tdata_025/dblogs'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 1ch/28d Inode: 2017 Links: 15...
2,853
Posted By urello
It works. Thanks alot.
It works. Thanks alot.
2,853
Posted By urello
As i understood this should do the trick find...
As i understood this should do the trick
find /opt/data_* -maxdepth 3 -type d -regex \(.*rvlogs.*\|.*main.*\) 2> /dev/null
But it didn't.
Showing results 1 to 25 of 64

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