Search Results

Search: Posts Made By: anbu23
305
Posted By anbu23
$ sort -t"," -k1,1 -u file ...
$ sort -t"," -k1,1 -u file
ENSG00000003137,ENST00000001146
ENSG00000003402,ENST00000309955
996
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
788
Posted By anbu23
Can you post expected output?
Can you post expected output?
190
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
1,320
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,467
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...
171
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"; ...
171
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
2,491
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,491
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,290
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,290
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,290
Posted By anbu23
Can you post what you have tried?
Can you post what you have tried?
387
Posted By anbu23
Can you post expected output?
Can you post expected output?
1,156
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,566
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,730
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 ) {
> ...
210
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,621
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,621
Posted By anbu23
Can you post expected output?
Can you post expected output?
1,478
Posted By anbu23
Yes
Yes
1,795
Posted By anbu23
Yes but use double quotes for variable...
Yes but use double quotes for variable substitution
var=1
sed "${var}..." file
1,795
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,503
Posted By anbu23
$ echo '[string 1 ] apple [ string 2]' | perl -pi...
$ echo '[string 1 ] apple [ string 2]' | perl -pi -e ' s/[[][^]]*]//g; '
apple
1,511
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 11:57 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy