Search Results

Search: Posts Made By: kumaran_5555
1,554
Posted By kumaran_5555
You should pass using -v option of awk as below ...
You should pass using -v option of awk as below

x=100
awk -v fromShellX=$x 'BEGIN{print fromShellX}' /dev/null


in your case modifiy as

awk -v a=$a,b=$b '$1>=a&&$1<=b {print...
1,814
Posted By kumaran_5555
Code for @joeyg logFile=$1 while [ 1 ] ...
Code for @joeyg
logFile=$1

while [ 1 ]
do
curr=`wc -l $logFile`
if [ "$curr" != "$prev" ]
then
echo "Command to execute"
fi
prev=$curr
sleep 1

done


If you are looking for...
Forum: Programming 05-19-2010
11,570
Posted By kumaran_5555
I have checked for the library -bash-3.1$...
I have checked for the library

-bash-3.1$ find . -name *mqcrt* 2>/dev/null
-bash-3.1$ pwd
/
-bash-3.1$


but i couldn't find one... is thery anyway to download and use it.
Please help me on...
2,073
Posted By kumaran_5555
I have already given one logic for capturing...
I have already given one logic for capturing start date to end date in the previous post. Now you can use those dates one by one in your oracle query.

If this isn't your requirement, then give us...
2,073
Posted By kumaran_5555
For item number 1, I have already given a...
For item number 1, I have already given a solution which worked well for me while providing start date and end date.

For 2,
you could use isql to connect to your DB and execute a query which will...
12,978
Posted By kumaran_5555
This code should work for you If your...
This code should work for you

If your seperator is pipe instead of comma use replace the dot with pipe inside -F"[-,:. ]"


awk -F"[-,:. ]" '

BEGIN{
min_date="99999999"...
Forum: Programming 06-14-2011
4,119
Posted By kumaran_5555
compile your program with -g option and then...
compile your program with -g option and then execute, gdb.

I think you have posted only the one function, the problem could be even at the callee side, how the return value is being used there.
...
2,253
Posted By kumaran_5555
This works, make sure you have two columns after...
This works, make sure you have two columns after pic to avoid bad results,


awk '{for(i=1;i<=NF;i++){if($i=="PIC"){print $(i-1) $(i+1) $(i+2)}}} ' test.txt
2,869
Posted By kumaran_5555
Here is the output i have got, using solaris with...
Here is the output i have got, using solaris with nawk. Can you check are we on the same page.
user@tonga> (/home/user) $ echo $a $b $f
2 1 test.txt
user@tonga> (/home/user) $ cat test.txt
TABLE1...
2,869
Posted By kumaran_5555
Try this, awk -v v1=${POSITIONS_CASE5[${j}]}-v...
Try this,
awk -v v1=${POSITIONS_CASE5[${j}]}-v v2=${B}-v v3=file02.dat '{if(NR!=v1 ){print;next}system("head -"v2" "v3"|tail -1")}' ${TMPFILE}1 > ${TMPFILE}2
2,869
Posted By kumaran_5555
the below line is wrong, awk '{if(NR!=v1...
the below line is wrong,
awk '{if(NR!=v1 ){print;next}system("head -v2 v3|tail -1")}' v1=${POSITIONS_CASE5[${j}]} v2=${B} v3=file02.dat Instead of this, try this one

awk -v...
2,869
Posted By kumaran_5555
awk '{if(NR!=5){print;next}system("head -4...
awk '{if(NR!=5){print;next}system("head -4 file2|tail -1")}' file1
5,639
Posted By kumaran_5555
See by executing `wc -w text.txt` you are taking...
See by executing `wc -w text.txt` you are taking all word count in one go, then why are you using loop again.


maintain a variable to hold the line number and increment it each time inside the...
12,968
Posted By kumaran_5555
Try this user@tioman> (/home/user) $ cat...
Try this

user@tioman> (/home/user) $ cat test.sh
#!/bin/bash


filename="tmp.txt"

sort -n $1 >$filename


rows=`wc -l $filename|cut -d' ' -f1`
q2=`echo "($rows+1)/2" |bc`

q1=`echo...
5,639
Posted By kumaran_5555
To calculate how many lines you can use, wc...
To calculate how many lines you can use,

wc -l filename.txt

To calulcate how many words /line,

awk '{print NR NF}' filename
Forum: Ubuntu 06-03-2011
5,831
Posted By kumaran_5555
Please post such questions under Shell Scripting...
Please post such questions under Shell Scripting Forum. You will receive faster and may be better replies.
Forum: Ubuntu 06-03-2011
5,831
Posted By kumaran_5555
Hope this is what you are looking for ...
Hope this is what you are looking for
cgi@tioman> (/home/cgi) $ awk '{if(NR==1){print}else{for(i=1;i<=NF;i++){ printf "%s\t",$i ;if($i==0){printf "\n"; next} }}}' test.txt

Bh1 Bh2 Bh3 Bh4...
7,731
Posted By kumaran_5555
Can you whether the following part is working...
Can you whether the following part is working fine at your prompt.
I couldn't check that part as sshcmd isn't installed in my pc.

sshcmd -u ${vtier[$i]} -s ${vtier[$i]} df -k . | awk '{ print $5...
3,995
Posted By kumaran_5555
user@host> (/home/user) $ a=10 user@host>...
user@host> (/home/user) $ a=10
user@host> (/home/user) $ vi test.sh
user@host> (/home/user) $
user@host> (/home/user) $
user@host> (/home/user) $ ./test.sh

user@host> (/home/user) $ echo $a...
3,995
Posted By kumaran_5555
It is working fine for me.Please check whether...
It is working fine for me.Please check whether your IP is correct and try to FTP manually for that IP.

user@host2> (/home/user) $ cat test.sh
#!/bin/bash
function upload(){
ftp -inv...
3,995
Posted By kumaran_5555
function upload(){ ftp -inv $hostname <<EOF ...
function upload(){
ftp -inv $hostname <<EOF
user $user_name $pass_word
put $file_name
bye
EOF
}
This will work. You wrote the function wrong.
3,995
Posted By kumaran_5555
you have to use ftp -inv $hostname ...
you have to use


ftp -inv $hostname
user $user_name $pass_word
7,731
Posted By kumaran_5555
We won't be able to write the entire script for...
We won't be able to write the entire script for you. We will give the key idea and you can develop on it.

First executing a command in the remote server.


cgi@tioman> (/home/cgi) $ ssh...
8,966
Posted By kumaran_5555
You have to identify a condition to make sure...
You have to identify a condition to make sure that process.sh has completed its function. Once that is done, you can star the process.sh in background using & at the end instead of just executing it....
1,516
Posted By kumaran_5555
If you want the new record to be in the same...
If you want the new record to be in the same line, then you can use awk to do that. or few head and tail commands with line number will help.

I am giving a simple example with awk here,

...
Showing results 1 to 25 of 49

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