Search Results

Search: Posts Made By: Lucas_0418
3,615
Posted By Lucas_0418
Hi raokl, This is only a method that I...
Hi raokl,
This is only a method that I thought without test.
echo $a|awk '{i=1;while($i){if($i~/[*?]/){printf "%s",$i;exit};i++}}' FS=','
19,607
Posted By Lucas_0418
Hi guy, Don't know if u r using bash for...
Hi guy,
Don't know if u r using bash for this, if so, u could try this:
$ ./k.sh file3
Line 1: The world is a wonderful place to stay
arr[0]=The
arr[1]=world
arr[2]=is
arr[3]=a...
1,421
Posted By Lucas_0418
Hi guy, May this a not very good method. ...
Hi guy,
May this a not very good method.
awk '$2=="I"{I[$3$4]=$0}$2=="U"&&!I[$3$4]{U[$3$4]=$0}$2=="D"{if(I[$3$4]){delete I[$3$4]}else{D[$3$4]=$0}}
END{{for(i in I){print I[i]}}{for(u in...
3,676
Posted By Lucas_0418
Thank you ibmtech, thanks for your reply,...
Thank you ibmtech,
thanks for your reply, my mistakes, it's not a problem of some AIX's privilege or user's limits.
6,728
Posted By Lucas_0418
Hi Alister, Thanks for your reply, let me...
Hi Alister,
Thanks for your reply, let me realize that the while - read loop is totally unnecessary, I made the problem more complicated, since it is so simple. and you are very right that...
11,369
Posted By Lucas_0418
why you change '3078=' to '5022=', you always...
why you change '3078=' to '5022=', you always change what you expected, of cause a solution to one problem could not solve another problem.

I use pattern |3078= not 3078=
there is not a | before...
6,728
Posted By Lucas_0418
Just do some check for the arguments $ cat...
Just do some check for the arguments
$ cat test.sh
#!/bin/sh
if [ $# -eq 0 ];then
while read -r line
do
case "$line" in
quit|Quit)
exit 0;;
...
11,369
Posted By Lucas_0418
Hi clippertm, Let's use awk instead of...
Hi clippertm,
Let's use awk instead of grep, try this, it works fine in my cygwin, hope it could work in your cygwin too.
awk...
3,676
Posted By Lucas_0418
[solved]Help with AIX port limit
Hi guys,
I have a problem need to solve urgently, please help me, any suggestion will be great.
When my workmates installed a control-m agent in an AIX 6.1 OS, they got an error below:
...
1,906
Posted By Lucas_0418
Hi , The codes run successfully in my...
Hi ,
The codes run successfully in my cygwin environment, and I am sorry that I can't get any more test environment in weekend.
What's your environment , OS ? awk version ?
And I...
1,906
Posted By Lucas_0418
Hi guy, I used ' echo something | ' to...
Hi guy,

I used ' echo something | ' to be stdin of the awk in my reply, and if you want to use a file name, don't use pipeline | like that, otherwise you will get an error.

And I saw...
1,906
Posted By Lucas_0418
Hi guy, try this and may it could work.$...
Hi guy,
try this and may it could work.$ echo '1001 000 HEADER
1001 001 RAJESH
1001 002 100
1001 002 200
1001 002 500
1001 006 FOOTER
1002 000 HEADER
1002 001 RAMESH
1002 002 100
1002...
931
Posted By Lucas_0418
Hi guy, If you could use pair of "grep -n"...
Hi guy,
If you could use pair of "grep -n" to locate every segment that you needed in the file. Why not use sed directly.
sed -n '/<eligibilityRequest/,/<\/eligibilityRequest/p'...
1,631
Posted By Lucas_0418
Hah, also you could remove the previous mark file...
Hah, also you could remove the previous mark file and touch a new one with the same name in the end of your script, you just need to choose a specific file name for every system~
1,631
Posted By Lucas_0418
I'm sorry to hear that, the 'find' in your OS...
I'm sorry to hear that, the 'find' in your OS must frustrated you..

Are you able to touch some file in the directory that you are monitoring ?
If so, you could run your script via cron every...
1,631
Posted By Lucas_0418
Hi guy, I'm confused, I remeber that even...
Hi guy,
I'm confused, I remeber that even solaris 'find' has some option just like "cmin amin mmin".
find /path -type f -mmin+60
You could find the files that have turned up and not sent...
11,369
Posted By Lucas_0418
Hi clippertm, Have you tried the cat...
Hi clippertm,
Have you tried the cat *.*|grep, I think if your pattern file is something like this: (I posted yesterday)
4=745|[^|]\{1,\}|3078=
4=746|[^|]\{1,\}|3078=
4=747|[^|]\{1,\}|3078=...
11,369
Posted By Lucas_0418
Sorry clippertm, I think the problem of...
Sorry clippertm,
I think the problem of output all occurences is that we used the wildcard *.*
so maybe we must use sort after grep
Or use perl or awk as apmcd47 say, u know, both...
11,369
Posted By Lucas_0418
Sorry clippertm, I made a mistake, delete...
Sorry clippertm,
I made a mistake, delete the double plus.
grep -h '4=[745-755]' *.* | grep '3078=' | sort -u -t'|' -k2,2?
If [745-755] is not available, use this:
grep -h...
11,369
Posted By Lucas_0418
What's your environment, found that your code...
What's your environment, found that your code could work in my cygwin.
grep -h '4=[745-755]++' *.* | grep '3078=' | sort -u -t'|' -k2,2
May you could put all the pattern in a file, then use...
11,369
Posted By Lucas_0418
Hi clippertm, Confusing with "The values in...
Hi clippertm,
Confusing with "The values in the file are "line" separated: each value has its own line." Does the data file not be separated by '|' ? or you are talking about the pattern file ?...
Forum: Programming 03-20-2014
2,541
Posted By Lucas_0418
Hi guy, this is a method to get your...
Hi guy,
this is a method to get your desired output, and it is modified from your code, may help u
awk '$1*1000%50==0{if($1/0.05>cnt){for(i=cnt;i<$1/0.05;i++){printf "%-8s %-8s\n", ...
11,369
Posted By Lucas_0418
Hi clippertm, Shall we use sort -u -t'|'...
Hi clippertm,
Shall we use sort -u -t'|' -k2,2 instead of uniq?
1,724
Posted By Lucas_0418
Hi, store them in var1, var2, var3 ... ok? ...
Hi,
store them in var1, var2, var3 ... ok?

#!/bin/bash
Variable=MKT1,MKT2,MKT3
IFS=','
i=1
for j in ${Variable[@]}
do
eval var$i=$j
i=`expr $i + 1`
done
1,396
Posted By Lucas_0418
Hi Scrutinizer, Thanks for reminding me,...
Hi Scrutinizer,
Thanks for reminding me, when I was coding, I felt that I am missing something like bound check, but when I saw the result is correct and there is another thing disturbed me...
Showing results 1 to 25 of 65

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