Search Results

Search: Posts Made By: Niroj
2,587
Posted By Niroj
Redirecting path1 to path2
Hi All,

path1="/opt/YAK/N78"
path2="/opt/YAK/N79"

I need to do such a way that when I will invoke "cd $path1" it should redirect me to $path2.

Humm.. tried to use link, alias and export...
2,590
Posted By Niroj
Thanks summer_cherry. But I want to do the...
Thanks summer_cherry.

But I want to do the whole things only by pattern matching.

---------- Post updated at 05:17 AM ---------- Previous update was at 05:15 AM ----------

Input is changed...
2,590
Posted By Niroj
Perl Repetitive Pattern Matching
Problem:

GIVEN
=======
my $sql="INSERT INTO table_nm(a, b, b, d, e, f , g) VALUES (2046, TODAY, 'Change Subscription Name', '00000000000002000000000000000000000000000000000000',...
1,613
Posted By Niroj
Hey no no...! I just put '//' for general...
Hey no no...! I just put '//' for general purpose.. not in scripting:)..

This is a real issue... I am facing
I am using Notepad++ editor to write/ftp into unix box. The Perl script I have...
3,245
Posted By Niroj
Hi Kelvin ! I suggested so, as asked by...
Hi Kelvin !

I suggested so, as asked by pritish.
11,871
Posted By Niroj
Use pattern matching
if [ `echo $num / 2 | bc -l | grep -c "[0-9]*\.00000000000000000000" ` = 1 ]
then
echo "OK"
else
echo "KO"
fi
1,613
Posted By Niroj
Perl scripting absurd error !!
I am facing strange compilation errors while doing Perl scripting:

Example: suppose my code contain

my $line=1;
call_fun($line); // call_fun is a function
my $line1=2;

It is not showing...
3,245
Posted By Niroj
Use patten matching
$number=~ s/([^\.]*\.)(...).*/$1$2/;

---------- Post updated at 01:30 AM ---------- Previous update was at 01:14 AM ----------



You can also use:

$number=~ s/(\d*\.)(\d{0,3}).*/$1$2/;
3,014
Posted By Niroj
Thanks KevinADC & jim mcnamara ! Actually I...
Thanks KevinADC & jim mcnamara !

Actually I am reading a dbscript file which contains the SQL statements like "SELECT emp_id FROM EMPLOYEE......;" , " UPDATE ..........;" etc including the other...
3,014
Posted By Niroj
unix2dos is used for converting unix format to...
unix2dos is used for converting unix format to dos format. Here we can identify that by seeing the line break(^M).

But in my case it is not showing any special character in UNIX os. Just the...
3,014
Posted By Niroj
Perl Pattern Matching:Unix Vs. Window (Is it OS dependent??)
Hi All,

Below I am discussing the problem I am facing while using pattern matching in Unix & Window. Plz hv a look into it.
================
my $s="UPDATE A
SET s="klkkk'
;" ;

if ( $s =~...
8,863
Posted By Niroj
Thanks a lot..
:b::b: Thank u very much..
It is working fine...

Hey plz delete # Getting Wrong o/p in ur answers bcoz
Other ppl may refer it & may think what u sent is not correct..
:)
8,863
Posted By Niroj
oh....! U took the advantage of 'c' here which is...
oh....! U took the advantage of 'c' here which is just an example..
ok let u give the real example whr i m facing the problem:


$sql=" UPDATE tab_nm SET string_nm =' 12th dec, 1984, 'op=1 '...
8,863
Posted By Niroj
Sorry I gave the wrong i/p: This is the...
Sorry I gave the wrong i/p:

This is the exact string:

my $str = " c1 ='mmdnn, , sdm = 'sm' ,m ,jkjk' , c2 = 'chj= kjk'' , khj ', c3='hhshhj, hsjh' ";
8,863
Posted By Niroj
:b: Thanks agn Kalvin! The below is the new one...
:b:
Thanks agn Kalvin! The below is the new one I need to solve. Here the same type of string is present but I want the o/p differently.

my $str = " c1 ='mmdnn, ,sdm = sm,m,jkjk',c2 = 'chj=kjk,...
8,863
Posted By Niroj
Another one of same type...!!
Thanks agn Kalvin! The below is the new one I need to solve. Here the same type of string is present but I want the o/p differently.

my $str = " c1 ='mmdnn, ,sdm = sm,m,jkjk',c2 = 'chj=kjk, khj...
8,863
Posted By Niroj
o/p=> c1: c2: c3: :b: Thanks Kelvin ! But...
o/p=> c1: c2: c3:
:b: Thanks Kelvin ! But could plz explain How does it work for c3='hg5 sh'.
(c3='.....' does not end with a comma "," !!)?

And my 2nd query is why "$str =~ s/='.*',?/:/g;"...
8,863
Posted By Niroj
Trying more...
my $str=" c1='fgfasfgasggfgff.,akhk', c2='bbbn', c3='hg5 sh' ";
print "Before substitution-> $str\n";
$str=~ s/(=.*\'.*\'.*,?)/:/g;

print "After substitution-> str= $str\n";

o/p:...
8,863
Posted By Niroj
Perl:string substitution Pattern: ='abc...',
Hi friends,

I want to substitute "a ='....'," with ":" in everywhere in a string using Perl.

Details:
----------
my $str= " c1='fgfasfgasggfgff.,akhkhahha', c2='bbbn', c3='hg5 sh' ";
...
3,730
Posted By Niroj
visibility of a variable in Perl script.
I am writing a script to cross check the dbscript. For that I am searching the SQL manipulators in the dbscript as shown below. But my problem is the variable $pattern is coming as null when comes...
3,528
Posted By Niroj
Got the solution to get the cursor pos dynamically
Actually this solution I got from a site..

for num in 1 10 3 145
do
tput sc //Save the current cursor position
echo "$num\c"
tput rc //Recover the saved cursor...
3,528
Posted By Niroj
Actual problem is how to get the variable cursur point !
Thanks Franklin..

But the actual problem here is to get the cursor position dynamically. The cursor pos is variable and this prog need to get the printing position before printing to that...
3,528
Posted By Niroj
Print a message at specific line on prompt
Hi Friends,
I am using HP-UNIX(ksh). I want to print a message at specific line on the prompt screen. For Example:

for num in 1 10 3 145
do
echo $num // need to print this on the same line...
2,274
Posted By Niroj
:b:Thanks zaxxon
:b:Thanks zaxxon
2,274
Posted By Niroj
To substitute a string in a line to another string
Suppose,

d=ABC*.BGH.LKJ

Now I want to replace 'DEFGHIJ' instead of '*.B' and store the value in d. Any Idea? Can we use sed here?

The outout should be like this:

d=ABCDEFGHIJGH.LKJ
...
Showing results 1 to 25 of 56

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