Search Results

Search: Posts Made By: neelmani
2,207
Posted By Scrutinizer
Sure: /(.*select/!N if the line consists of...
Sure:
/(.*select/!N if the line consists of a "(" followed by "select" then do not append the next line to the buffer..
//p repeat the previous match operation ( "(" followed by...
2,207
Posted By Scrutinizer
sed -n '/(/{/(.*select/!N;//p;}' infile
sed -n '/(/{/(.*select/!N;//p;}' infile
2,207
Posted By elixir_sinari
My bad. Try a slight modification: sed -n...
My bad.
Try a slight modification:
sed -n ':strt
/([[:space:]]*select/{;p;b;}
/([[:space:]]*$/{;N;b strt;}' file
3,327
Posted By Ygor
Try...$ cat file1 : select col1 , col2 from...
Try...$ cat file1
:
select col1 , col2 from /* selecting columns from the table1 */ table1;
:
/* etc1
etc2
*/
:
select col1 , col2
from /* selecting columns from the table1 */...
20,135
Posted By guruprasadpr
Hi Re-direct the output to a temporary...
Hi

Re-direct the output to a temporary file, and then rename the file to the original one:

tr -d '\015' <y.sql >x.sql
mv x.sql y.sql

Guru
20,135
Posted By zaxxon
This is asked very often - you can use the search...
This is asked very often - you can use the search function of the forum to get a solution/alternative.
Not sure why your dos2unix complains, but you can try this:

tr -d '\015' < winfile > unixfile
20,135
Posted By guruprasadpr
Hi It has to be like Zaxxon mentioned: ...
Hi

It has to be like Zaxxon mentioned:

tr -d '\015' <y.sql >x.sql

Guru.
4,861
Posted By elixir_sinari
I assume that you meant "variable" instead of...
I assume that you meant "variable" instead of "file".

In that case, try


word="as"
awk "/^$word$/{print p}{p=\$0}" file
4,861
Posted By rangarasan
awk
we are storing the previous value in p variable and using whenever required.
4,861
Posted By elixir_sinari
Just tweaking the previous solution a bit to get...
Just tweaking the previous solution a bit to get the correct results:


awk '/^as$/{print p}{p=$0}' file
4,861
Posted By rangarasan
Awk
Hi,

Try this one,

awk '/as/{print p;}{p=$0;}' file

use nawk instead of awk if you dont have awk.
Cheers,
Ranga:-)
1,003
Posted By bartus11
Perl command will work in your shell, you just...
Perl command will work in your shell, you just have to have Perl installed (which it is in 99% of the cases). Anyway, here is some AWK:
awk '/table1/{getline;if ($0==",") {getline;print}}' file.txt
2,695
Posted By Scrutinizer
/usr/bin/grep is not the POSIX compliant version...
/usr/bin/grep is not the POSIX compliant version on Solaris. POSIX compliant versions of utilities can be found in /usr/xpg4/bin or /usr/xpg6/bin
2,695
Posted By Scrutinizer
@neelmani: Use /usr/xpg4/bin/grep instead of...
@neelmani:
Use /usr/xpg4/bin/grep instead of grep
2,695
Posted By Scrutinizer
Try -x for whole line match.. # is not a word...
Try -x for whole line match.. # is not a word character and therefore sachin is considered a word...
2,751
Posted By donadarsh
try it this way. capture the process id of sub...
try it this way.
capture the process id of sub process and keep checking for completion in a loop after some interval.

wrapper.ksh
########################
#!/bin/ksh

nohup ./pii_insert.ksh...
1,264
Posted By Corona688
They are all in the same folder that way, but...
They are all in the same folder that way, but they don't have to be. You could as easily do relative/path/script.sh & or /absolute/path/to/script.sh &.

And yes, it will work in KSH. It will work...
1,264
Posted By Corona688
#!/bin/sh ./bg1.ksh & # One & on the end...
#!/bin/sh

./bg1.ksh & # One & on the end means 'run it in the background'.
./bg2.ksh &
wait # This will wait for both of them to finish.

./test2.ksh # This one gets run in the foreground.
2,614
Posted By Scrutinizer
awk OK? /usr/xpg4/bin/awk -Fproc_name '{print...
awk OK?
/usr/xpg4/bin/awk -Fproc_name '{print substr($1,length($1),1) substr($2,1,1)}'

sed:
sed 's/.*\(.\)proc_name\(.\).*/\1\2/; s/^proc_name\(.\).*/\1/; s/.*\(.\)proc_name$/\1/;...
2,614
Posted By Scrutinizer
Try: perl -pe 's/.*?(.?)proc_name(.?).*/$1$2/'
Try:
perl -pe 's/.*?(.?)proc_name(.?).*/$1$2/'
3,079
Posted By Scrutinizer
Yes..
Yes..
3,079
Posted By bakunin
Two ways: 1. display the content of the...
Two ways:

1. display the content of the (system)-variable "${.sh.version}". This is from my system:

# print ${.sh.version}
Version JM 93t+ 2010-03-05

2. switch to "vi"-command line editing...
4,597
Posted By itkamaraj
$ echo ",table2.col2,tableone.column1," | nawk...
$ echo ",table2.col2,tableone.column1," | nawk -F, '{for(i=1;i<=NF;i++){if($i~/\./){split($i,a,".");print a[1]}}}'
table2
tableone
3,079
Posted By itkamaraj
you can check with fold command fold...
you can check with fold command


fold -w1 input.txt
Showing results 1 to 24 of 28

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