Search Results

Search: Posts Made By: complex.invoke
Forum: What is on Your Mind? 04-23-2019
2,384
Posted By complex.invoke
GitHub - MSWorkers/support.996.ICU: Microsoft and...
GitHub - MSWorkers/support.996.ICU: Microsoft and GitHub Workers Support 996.ICU (https://github.com/msworkers/support.996.ICU)
1,882
Posted By complex.invoke
awk '!a[$1]++' infile
awk '!a[$1]++' infile
2,409
Posted By complex.invoke
sed 's!\([^ ]*\) \{1,\}\([^_]*\)\([^ ]*\)...
sed 's!\([^ ]*\) \{1,\}\([^_]*\)\([^ ]*\) \{1,\}\([^ ]*\).*!\1 \2 \4!g' infile
1,622
Posted By complex.invoke
sed 's!/rakesh/!rakesh!g' sample.txt or ...
sed 's!/rakesh/!rakesh!g' sample.txt

or

sed '/rakesh/s!/!!g' sample.txt
1,045
Posted By complex.invoke
sed...
sed 's!\(.\{5\}\)\(.\{4\}\)\(.\)\(.\{4\}\)\(.\{2\}\)\(.\)\(.*\)!\1|\2|\3|\4|\5|\6!g' infile
2,606
Posted By complex.invoke
awk...
awk '{if(a[$1FS$2]<$3)a[$1FS$2]=$3;if(!key[$1FS$2])key[$1FS$2]=$NF}END{for(i in a)print i,a[i],key[i]}' infile
1,064
Posted By complex.invoke
awk '{gsub(/>/,RS $1 FS)}1' infile
awk '{gsub(/>/,RS $1 FS)}1' infile
12,511
Posted By complex.invoke
sed 's:\.[^|]*::g' infile
sed 's:\.[^|]*::g' infile
3,951
Posted By complex.invoke
awk '{sum[$2]+=$1}END{for(i in sum) print...
awk '{sum[$2]+=$1}END{for(i in sum) print sum[i],i}' file1 file2
6,266
Posted By complex.invoke
Expect script is useless here, just perform your...
Expect script is useless here, just perform your tasks through the pure shell script
An example

echo "n
p
1


w" | fdisk /dev/sdb

just modify the parameters to suit your requirements
1,351
Posted By complex.invoke
sed 's:\(.*/\)\(.*\):& \2:' infile
sed 's:\(.*/\)\(.*\):& \2:' infile
2,709
Posted By complex.invoke
[root@node3 ~]# cat infile a b c d e f g h...
[root@node3 ~]# cat infile
a b c
d e f
g h i
j k l

case1:

[root@node3 ~]# bash transpose infile
a d g j
b e h k
c f i l

case2:

[root@node3 ~]# awk '{print $3}' infile | bash...
2,306
Posted By complex.invoke
awk '{t=$1;$1="";a[t]=a[t]$0";"}END{for(i in...
awk '{t=$1;$1="";a[t]=a[t]$0";"}END{for(i in a)print i,a[i]}' infile | sed 's/;$//'
2,026
Posted By complex.invoke
for i in *.jpeg; do mv "${i}"...
for i in *.jpeg; do
mv "${i}" "${i/jpy/hhk}"
done

or

rename jpy hhk *.jpeg
2,709
Posted By complex.invoke
#!/bin/bash # # transpose ...
#!/bin/bash
#
# transpose

transpose()
{
awk '
{
if(max_nf<NF)
max_nf=NF
max_nr=NR
for(x=1; x<=NF; ++x)
...
995
Posted By complex.invoke
awk '$1{gsub(/\n/," ");print RS$0}' RS="name"...
awk '$1{gsub(/\n/," ");print RS$0}' RS="name" infile
8,205
Posted By complex.invoke
}' RS=";" ${1} The font in red defines the...
}' RS=";" ${1}

The font in red defines the Record Separator
I'm not familiar with ksh,sorry
8,205
Posted By complex.invoke
[root@node3 ~]# cat infile A|123|446pr; ...
[root@node3 ~]# cat infile
A|123|446pr;
B|46|hello89
krp;
C|78|ystp90
67;
D|ga|456;
[root@node3 ~]# cat 2D_awk_array.sh
awk -F\| '
{
gsub(/\n/,"",$0)
if (max_nf<NF) ...
9,475
Posted By complex.invoke
[root@node2 ~]# sed -n '/C$/!p' infile ...
[root@node2 ~]# sed -n '/C$/!p' infile
def,adc,asdf,123,12A
[root@node2 ~]# sed -n '/C$/p' infile
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
11,023
Posted By complex.invoke
awk...
awk '{printf("%d:",NR);len=0;for(i=1;i!=NF;++i){len+=length($i)+1;printf("%d ",len)}printf("\n")}' FS="?" infile

or

awk '{printf("%d:",NR)}{for(i=1;i<=NF;++i)if($i == "?")printf("%d...
1,809
Posted By complex.invoke
for i in myIPgrp{1..10}; do echo ${!i}...
for i in myIPgrp{1..10}; do
echo ${!i}
done
2,476
Posted By complex.invoke
$! holds the PID of the last background process...
$! holds the PID of the last background process that was executed
2,139
Posted By complex.invoke
lsof -i -p 9402 | sed...
lsof -i -p 9402 | sed '/9402/!d;s/\(.*\)->\(.*\):\(.*\)/\2/g' | awk '{++a[$1]}END{for(i in a)print i,a[i]}'
2,002
Posted By complex.invoke
sed 's/][^]]*\[/ /g' infile | sed...
sed 's/][^]]*\[/ /g' infile | sed 's/.*\[\([^]]*\).*/\1/'
2,357
Posted By complex.invoke
grep -f host.list <(sed -e...
grep -f host.list <(sed -e '/address\|host_name/!d' host.conf | sed -n 'h;n;H;x;s/\n/ /;p') | awk '{print $NF,"------",$2}'
Showing results 1 to 25 of 54

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