Search Results

Search: Posts Made By: rangarasan
2,585
Posted By rangarasan
You are almost done with it. awk ' ...
You are almost done with it.


awk '
NR == FNR {min[$1]=$3; max[$1]=$4; Gene[$1]=$NF; next}
{
for (id in min)
if (min < $2 && $2...
6,070
Posted By rangarasan
gsub
Hint: gsub

sub() awk function replaces the first occurrences of the string.

gsub() awk function replaces all the occurrences of the string.

Cheers!
Ranga
1,169
Posted By rangarasan
Tim, How about this? #!...
Tim,

How about this?


#! /usr/bin/perl

use strict;
use warnings;

my $file = 'input_file'; ## Change you input file name
my %info = ();
my %ports = ();

if(open(IFILE, "<", $file)) {...
Forum: What is on Your Mind? 12-31-2015
2,356
Posted By rangarasan
Happy new year 2016 !!!! Have a great year ahead...
Happy new year 2016 !!!! Have a great year ahead !!!!

Cheers!
Ranga :)
14,922
Posted By rangarasan
Couple of things, You don't need to use cat to...
Couple of things, You don't need to use cat to pass the file content to awk. It's useless use of cat.

You can specify the single quote to get the shell variable interpolate.


awk -F,...
10,034
Posted By rangarasan
How about bash? cadena="cual es mi largo"...
How about bash?


cadena="cual es mi largo"
echo "cadena : ${#cadena}"


-Ranga
17,898
Posted By rangarasan
You need to allow the perl interpreter to...
You need to allow the perl interpreter to interpolate perl variables.

Just try this.!


system("wget -q --no-check-certificate -O /tmp/DataFile_$TimeStamp 'https://foobar.com/html' ") ;

...
2,229
Posted By rangarasan
Well, What have you tried so far? Anyways,...
Well, What have you tried so far?

Anyways, Here it is..

sed 's/^Delete_[0-9]*_//' file_name


-Ranga
1,970
Posted By rangarasan
Hi.. How about dynamic variable assignment. ...
Hi..

How about dynamic variable assignment.


perl -lne 'if(/exec/){$q="";$c=1;$qc++;}if($c){$q = join(" ", $q,...
4,298
Posted By rangarasan
Well, How about this? awk...
Well, How about this?


awk '/source/{file=$3".txt";next;}!/END/{print $0 >>file}' input_split.txt


-Ranga
1,634
Posted By rangarasan
Well, try sed -r 's#\.\.(/\.\.)*#%HOME%#'...
Well, try


sed -r 's#\.\.(/\.\.)*#%HOME%#' file


-Ranga
1,812
Posted By rangarasan
Just a thought!!! Why you need to use...
Just a thought!!!

Why you need to use substr, match.. etc?


awk -F'<String>|</String>' '/<Node/{for(i=2;i<=NF;i+=2) print $i;}' file_name


-Ranga
1,929
Posted By rangarasan
In bash, pipefail option will do the trick. ...
In bash, pipefail option will do the trick.

Set the pipefail option in top of your bash script.

set -o pipefail

-Ranga
1,535
Posted By rangarasan
My Bad, Typo..
My Bad, Typo..
1,535
Posted By rangarasan
Hello, This should add text to beginning of...
Hello,

This should add text to beginning of the variable.


VAR="data" $VAR


Cheers!
Ranga
1,100
Posted By rangarasan
Getting junk data from MS SQL Server 2008 R2 using PHP 5.3.16
Hey!!!

I am just trying to connect MS SQL Server 2008 R2 from PHP Version 5.3.16 using IIS 7.0.

I am able to connect my MS Sql Server but I am getting junk data eventhough there is a valid...
1,086
Posted By rangarasan
Hi,, Try something like this.. ...
Hi,,

Try something like this..



my @allipsfound ;
my %ips = ();
for my $elem (@gatches) {
my ($ip) = split ":",$elem;
$ips{$ip} = 1;
}
print join('\n', sort keys %ips), "\n";
8,890
Posted By rangarasan
sed
Hey,

Try sth like this,


sed 's#<head>\(.*\)</head>#\1#' input_file


In awk, you can specify more than delimiter in -F option or FS variable.


awk -F'[<>\t]' '{print $3,$6;}'...
1,125
Posted By rangarasan
sed
Hey!!!

Please use code tags for data samples and codes.

Try sth like,


sed -i.bak 's/\(\/[^/]*\/[^/]*\)\1/\1/g' file_name


Here this command will work for your requirement like...
7,819
Posted By rangarasan
You can use maxdepth option in find command to...
You can use maxdepth option in find command to search in current directory only.

Cheers!
-R
3,548
Posted By rangarasan
Just try the above code :) Cheers!!! -R
Just try the above code :)

Cheers!!!
-R
6,293
Posted By rangarasan
Hey, If you want to take the fourth part of...
Hey,

If you want to take the fourth part of file name, you could do something like below,


ls pay*|awk -F':' '{print $4;}'


If you want to store the output of awk to a variable, you should...
1,711
Posted By rangarasan
grep
Hey,

Try sth like this,

If your grep supports -o option, It will give you first 6 characters of the string.


echo 'abcdefghij'|grep -o '^.\{6\}'

Cheers!!
-R
2,641
Posted By rangarasan
find
Hey,

You could use the find command's mtime option to accomplish this task.


find /target/directory/ -type f -mtime -1 -exec ls -ltr {} \;


Cheers!!!
-R
20,810
Posted By rangarasan
SFTP: Connection problem
HI,
I have generated public key and placed in remote server. When I am trying to do SFTP for that remote server the below error I am getting. Please help me to resolve

Connecting to hostname......
Showing results 1 to 25 of 493

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