Search Results

Search: Posts Made By: ranjithpr
2,352
Posted By ranjithpr
Try sed -n '45,50p' filename
Try

sed -n '45,50p' filename
3,227
Posted By ranjithpr
Hope this is what you were expecting
$ cat huge_file.txt
a
a
ab
b
hh
$ cat small_file.txt
a 1.5
b 2.5
ab 7.5
cd 1.1
$ awk 'NR==FNR{buff[$1]=$0;next} {if(buff[$1]!="") print buff[$1]}' small_file.txt huge_file.txt
a 1.5
a...
2,219
Posted By ranjithpr
Hi Arun, It can be done with a small...
Hi Arun,

It can be done with a small change in logic.


output="loop.csv"
tempfile="loop.tmp"
>$output
elements=${#currency_pair[@]}

for((i=0;i<$elements;i++)); do
echo...
18,189
Posted By ranjithpr
Below script worked in RedHat Enterprise Linux. ...
Below script worked in RedHat Enterprise Linux.


host=10.1.1.1
user=testuser
passwd=testpwd
lftp<<EOF
open sftp://$host
user $user $passwd
dir
EOF
18,189
Posted By ranjithpr
What is ur OS? In Rehad Enterprise Linux, I...
What is ur OS?

In Rehad Enterprise Linux, I could find a command 'lftp' which can be used to do SFTP and it can be used like 'ftp'.

You can use below command to check the availablity of 'lftp'....
1,150
Posted By ranjithpr
Hope below example will be helpful for you
$ myvar="LLM10 01 0100:0240"
$ echo $myvar
LLM10 01 0100:0240
$ echo "$myvar"
LLM10 01 0100:0240
$
3,408
Posted By ranjithpr
Both the commands gave me same output in small...
Both the commands gave me same output in small file. But I think awk is accurate than grep.
2,035
Posted By ranjithpr
Are you looking for something like this.
$ cat 1.txt
Position 1:10 -> CN0001N -
Position 252:255 -> 0292

Position 1:10 -> CN0001N -
Position 252:255 -> 7810

Position 1:10 -> CN0002N -
Position 252:255 -> 0111

Position 1:10 ->...
3,408
Posted By ranjithpr
Below commands also will give the line count, but...
Below commands also will give the line count, but no idea about its perfomance.

grep -c "\n" filename

awk 'END {print NR}' filename
8,570
Posted By ranjithpr
Hope this is what you were expecting
$ cat 1.txt
word1 line1 word2
word1 line2 word2
word1 line3 word2
word1 line4 word2
word1 "line5" word2
word1 line6 word2
word1 line7 word2
word1 "line5" word2
word1 line8 word2
word1 line9...
1,789
Posted By ranjithpr
Solution using awk
$ cat 1.txt
1|XXX
2|YYY
3|ZZZ
$ cat 2.txt
1|XXX
2|FFF
5|DDD
6|TTT



awk -F'|' 'FNR==NR {buff[$1]=$0;next}
{
if(buff[$1]=="") { new[$1]=$0;...
8,570
Posted By ranjithpr
Solution using awk
$ cat 1.txt
word1 line1 word2
word1 line2 word2
word1 line3 word2
word1 line4 word2
word1 line5 word2
word1 line6 word2
word1 line7 word2
word1 line5 word2
word1 line8 word2
word1 line9...
51,699
Posted By ranjithpr
If the permission of file...
If the permission of file '$ORACLE_HOME/bin/oracle' is not set properly then 'sqlplus' won't work for non-oracle users.

Permission of this file must be like '-rwsr-s--x'.

Regards,

Jith
51,699
Posted By ranjithpr
It is not required, but if you give it won't...
It is not required, but if you give it won't create any problem.

In command line, are you able to execute script '/home/ivbbuild/tosh.sh', Are you getting the expected result?

Above cron tab...
51,699
Posted By ranjithpr
Zaxxon mean in 'sqlplus' line, not in sql file. ...
Zaxxon mean in 'sqlplus' line, not in sql file. You have to add it like


/u01/app/oracle/product/9.0.1/bin/sqlplus -s xxxx/xxxx @/home/ivbbuild/rec.sql > /home/ivbbuild/rech.txt 2>&1
1,249
Posted By ranjithpr
Hope below example will be helpful $...
Hope below example will be helpful

$ myvar=/net/lockbox/vol/homes/j564redist.tar.gz
$ dirname $myvar
/net/lockbox/vol/homes


Regards,

Jith
51,699
Posted By ranjithpr
Hi Tosh, Have you terminated the SQL...
Hi Tosh,

Have you terminated the SQL statement inside '/home/ivbbuild/rec.sql' with semi colon?

Also exit is expected inside the SQL file when you do it in this fashion. Refer below example...
6,229
Posted By ranjithpr
Hi, Hope this will be helpful. $...
Hi,

Hope this will be helpful.


$ top -b -n 1| grep Cpu| cut -c35-39
83.7
$ echo `top -b -n 1| grep Cpu| cut -c35-39` + 1| bc -l
84.7
$ echo `top -b -n 1| grep Cpu| cut -c35-39` + 1|...
6,246
Posted By ranjithpr
Error while authentication in Mailing Program
Hi Experts,

I am using below Perl script to send mail through and Microsoft Exchange server.


#!/usr/bin/perl -w
use SendMail;

$smtpserver = "exchange_server.com";
$smtpport ...
10,830
Posted By ranjithpr
Try this, sed -i -e '/GuestUser/w...
Try this,

sed -i -e '/GuestUser/w output_file' -e '/GuestUser/d' input_file

Regards,

Ranjith
10,034
Posted By ranjithpr
Hi, Try this. awk...
Hi,

Try this.

awk '/<Placemark>/,/<\/Placemark>/ {print}' file

Regards,

Ranjith
5,874
Posted By ranjithpr
Try this awk '/Pritam/,/Patil/ {c++;}...
Try this

awk '/Pritam/,/Patil/ {c++;} /Patil/ {print c-2;c=0}' file

Regards,

Ranjith
2,182
Posted By ranjithpr
Hi, Here is your script with right...
Hi,

Here is your script with right commands and proper syntax.

>users
while true
do
who | cut -d' ' -f1 |sort > 5secs
diff -q users 5secs > /dev/null
if [ $? -eq 0 ]
then
...
4,375
Posted By ranjithpr
Try this, awk 'NR==1 {$NF=""}1' file ...
Try this,

awk 'NR==1 {$NF=""}1' file

Regards,

Ranjith
3,493
Posted By ranjithpr
Using awk awk 'NR!=1 &&...
Using awk

awk 'NR!=1 && $1~"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" {printf("\n")} {printf("%s",$0)} END{printf("\n")}' file

Regards,

Ranjith
Showing results 1 to 25 of 173

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