Search Results

Search: Posts Made By: anbu23
128
Posted By anbu23
$ sort -t"," -k1,1 -u file ...
$ sort -t"," -k1,1 -u file
ENSG00000003137,ENST00000001146
ENSG00000003402,ENST00000309955
988
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
783
Posted By anbu23
Can you post expected output?
Can you post expected output?
180
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
1,304
Posted By anbu23
$ cat check.sh fileprops="-rwxrwxrwx user1...
$ cat check.sh
fileprops="-rwxrwxrwx user1 2019-08-31 17:36 /fin/app/01/scripts/filename6.src 4294967295"
echo "FILE PROPERTY: $fileprops"
echo "PARAMETER3: $1"

if [[ "$1" ==...
2,457
Posted By anbu23
$ cat check.sh str=`echo $1 | sed -e...
$ cat check.sh
str=`echo $1 | sed -e 's#[\][\]n# #g'`
echo $str>check.now
$ bash -x ./check.sh '/fin/app/01/scripts\\n/fin/app/01/sql'
++ echo '/fin/app/01/scripts\\n/fin/app/01/sql'
++ sed -e...
168
Posted By anbu23
$ sed -e 's/[^\t]*id/& \ /g' -e...
$ sed -e 's/[^\t]*id/& \ /g' -e 's/[^\t]*alias_./& \ /g' file
Chr1 lnci exon 83801516 83803251 . - . gene_id "LINC01725"; transcript_id "LINC01725:44"; ...
168
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
2,479
Posted By anbu23
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed...
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
$ echo '/fin/app/scripts\\n/fin/app/01/sql' > file
$ sed -e 's#\\\\n# #g' file...
2,479
Posted By anbu23
$ echo $str | sed -e 's#\\n# #g'; ...
$ echo $str | sed -e 's#\\n# #g';
/fin/app/scripts /fin/app/01/sql
1,281
Posted By anbu23
If you don't have ">" in your input before...
If you don't have ">" in your input before vehicle then try
awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$2 } $0 ~ "Tyre : "Tyre { print veh } ' file

Or

$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ {...
1,281
Posted By anbu23
$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$0 }...
$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$0 } $0 ~ "Tyre : "Tyre { print veh } ' file
> Vehicle: BMW Class
Vehicle: Toyota Class
1,281
Posted By anbu23
Can you post what you have tried?
Can you post what you have tried?
378
Posted By anbu23
Can you post expected output?
Can you post expected output?
1,148
Posted By anbu23
$ awk ' FNR == NR { ky=$4; sub("_.*","",ky);...
$ awk ' FNR == NR { ky=$4; sub("_.*","",ky); arr[ky]=$0; next } {print arr[$1]} ' content.xls id.txt
NC_020815.1 1891831 1894692 virb4_A0A0H2X8Z4_ 1 954 1945
NC_020815.1 ...
2,555
Posted By anbu23
$ awk -v RS="\nName:" -v OFS="," -v FS="\n" -v...
$ awk -v RS="\nName:" -v OFS="," -v FS="\n" -v ORS="\nName:" ' { print $1 OFS $2 ($3 ? OFS $3 : "") } ' file
Name: serve1,has disk :Yes,dev (8):
Name: serve2,has disk :No,dev (8):
Name: serve3,has...
2,710
Posted By anbu23
$ awk '{ currKey = $2 } > currKey != prevKey {...
$ awk '{ currKey = $2 }
> currKey != prevKey { prt(); min=$3; cnt=0 }
> { prevRec=$0; prevKey=currKey; max=$3; cnt++ }
> END { prt() }
>
> function prt( f) {
> if ( cnt ) {
> ...
204
Posted By anbu23
$ cat file =(root)NOPASSWD:/usr/bin/vim ...
$ cat file
=(root)NOPASSWD:/usr/bin/vim
=(ALL)NOPASSWD:/usr/bin/vim
=NOPASSWD:/usr/bin/vim
=(user)NOPASSWD:/usr/bin/vim
$ egrep '=(\(root\)|\(ALL\))?NOPASSWD' file
=(root)NOPASSWD:/usr/bin/vim...
1,612
Posted By anbu23
If you want to print block which contains pattern...
If you want to print block which contains pattern devId="number"

awk -v RS="</alarms>" -v ORS="</alarms>" ' devId="number" ' logfile
1,612
Posted By anbu23
Can you post expected output?
Can you post expected output?
1,475
Posted By anbu23
Yes
Yes
1,789
Posted By anbu23
Yes but use double quotes for variable...
Yes but use double quotes for variable substitution
var=1
sed "${var}..." file
1,789
Posted By anbu23
You can add line number like this to run...
You can add line number like this to run substitute only on first line
sed -i "1{s/{+//;s/+}//;}" error.txt
1,499
Posted By anbu23
$ echo '[string 1 ] apple [ string 2]' | perl -pi...
$ echo '[string 1 ] apple [ string 2]' | perl -pi -e ' s/[[][^]]*]//g; '
apple
1,508
Posted By anbu23
$ awk -F'\\]|\\[|-|:' -v RS='\n>' ' NR == FNR {...
$ awk -F'\\]|\\[|-|:' -v RS='\n>' ' NR == FNR { gsub(" ",""); arr[$3]=1;next} arr[$2]{print ">" $0} ' f1 f2
>Contig_152:50833-51615
CGGAGTAGCTTCGATCAGCGTGACCGGTACCGAGCGACCGTCTTCAGTGAAGACGCGGCT...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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