Search Results

Search: Posts Made By: zaxxon
2,837
Posted By zaxxon
Else you could do something like this: awk...
Else you could do something like this:

awk -v q=\' '
{
s ? s=s ORS q $0 q : s=q $0 q
}
END{
printf("select * from table where name in (%s);\n", s)
}
' ORS=, infile


Output:
...
2,837
Posted By zaxxon
Your shell will not be able to do a SQL SELECT....
Your shell will not be able to do a SQL SELECT. So you want either just echo/print it out or you will have to put your SQL-client here like sqlplus for example with oracle etc.
Also the single quote...
Forum: AIX 07-06-2017
3,360
Posted By zaxxon
Some starting ideas: - process table with ps...
Some starting ideas:
- process table with ps -ef and check entries using a tty
- lslpp -h to find out if there is a package installed at some given date
2,289
Posted By zaxxon
$ awk -F, 'BEGIN{print "COL1,COL2"} NR>1 && $9...
$ awk -F, 'BEGIN{print "COL1,COL2"} NR>1 && $9 {print $1,$6}' OFS=, input.csv
COL1,COL2
1111,X100
3333,X300
4444,X400
2,642
Posted By zaxxon
You could try yourself, altering your code with...
You could try yourself, altering your code with what I explained already...


$ awk '{a[$1 FS $2 FS $3]++} END{for(e in a) if(a[e] > 1){print a[e], e}}' infile| sort -r
2 0.910094 Aahan Aabid
2...
4,146
Posted By zaxxon
See my comment in your post on using "urgent" in...
See my comment in your post on using "urgent" in the topic, thanks.

Your first script uses ksh syntax to declare an array with set -A. In your second script you use a shebang to call bash, which...
2,642
Posted By zaxxon
You are building a key with $3 and $4 where there...
You are building a key with $3 and $4 where there exists only fields $1 $2 $3 with an unaltered field separator.

If I understood it correct, you might want something like this?

$ awk '{a[$2 FS...
2,642
Posted By zaxxon
Please use code tags. Can you show your...
Please use code tags.

Can you show your tries?
6,558
Posted By zaxxon
I doubt rsync can just delete on the target...
I doubt rsync can just delete on the target without any sync.
Though there is a --delete-before option that might give you the needed place before it copies.
Forum: Red Hat 06-30-2017
2,774
Posted By zaxxon
This lacks a lot of information to increase the...
This lacks a lot of information to increase the chance for a helpful statement.
What is the script doing but sending a mail?
What means "more"? What was "before", ie. what changed?
If this script...
3,488
Posted By zaxxon
Try this: $ awk -F, 'sum < 12 {print; print...
Try this:

$ awk -F, 'sum < 12 {print; print sum+=$2; next} {print "RESET"; sum=$2; print; print sum}' infile
1,3,/informatica/apps/logs/fin/ote/TgtFiles/Destination/CWXX/CW1900
3...
Forum: AIX 06-30-2017
7,300
Posted By zaxxon
I have no experience with compiling Samba on AIX,...
I have no experience with compiling Samba on AIX, but there are a tad newer packages at Michael Perzl's (IBM) site My Open Source packages for AIX and Linux on POWER (http://www.perzl.org), 3.6.25...
Forum: AIX 06-22-2017
7,248
Posted By zaxxon
You might want to install the cifs filesets, if...
You might want to install the cifs filesets, if not already done and try it out.

Here are two pages from IBM about cifs:
1. IBM Knowledge Center - SMBFS mounting...
3,718
Posted By zaxxon
Is it always the line starting with 4 as...
Is it always the line starting with 4 as identifier when to join this line with the 2nd? Or is there any other kind of criteria which line to join with the 2nd?
Forum: Programming 03-07-2017
6,824
Posted By zaxxon
What have you tried so far?
What have you tried so far?
8,683
Posted By zaxxon
Without seeing the rest of the file I am...
Without seeing the rest of the file I am guessing. You can try this or maybe change it to your needs:

$ echo "h1,h2,h3,h4" | sed 's/h[0-9]\+/hi_&/g'
hi_h1,hi_h2,hi_h3,hi_h4
Forum: Linux 02-24-2017
3,255
Posted By zaxxon
I don't know this special case, but extracting a...
I don't know this special case, but extracting a tar-ball archive will usually have a version number in it's path/directory name and this is good.
What you refer to is that when it is finally...
Forum: IP Networking 02-20-2017
31,358
Posted By zaxxon
No clue why the MAC is not showing up in the ARP...
No clue why the MAC is not showing up in the ARP table but could you check if there is some firewall rules set up on the Linux box with:

iptables -L
6,732
Posted By zaxxon
If you want to prevent that someone changes this...
If you want to prevent that someone changes this script, that person can also just comment those lines.
Maybe an IDS (Intrusion Detection System) like Tripewire etc. is the better choice to watch...
13,013
Posted By zaxxon
The number of records which is NR contains the...
The number of records which is NR contains the current line number. awk has an END{} block, where when it is reached NR will have the number 21 as value in your case.
Anyway, I second what the...
1,646
Posted By zaxxon
Try: awk 'BEGIN{for(i=1;i<=6;i++) print i}'
Try:
awk 'BEGIN{for(i=1;i<=6;i++) print i}'
Forum: AIX 02-08-2017
7,258
Posted By zaxxon
So the command hostname showed localhost? In the...
So the command hostname showed localhost? In the large txt file hostname showed another name. I assume you changed somewhere localhost into that other name, before you rebooted? Or did you not change...
Forum: AIX 02-08-2017
7,258
Posted By zaxxon
That's good but would you tell where you changed...
That's good but would you tell where you changed what before the reboot?
2,937
Posted By zaxxon
I am sorry to say it but it seems that you lack...
I am sorry to say it but it seems that you lack so many basic fundamental things working with Unix/Linux and it also seems that all those really many threads of yours in the forum and all the answers...
2,144
Posted By zaxxon
You already have 317 posts in this forum and I...
You already have 317 posts in this forum and I bet you got lots of hints to your questions in the past. What would be the most obvious "bad habit" in this script?
Showing results 1 to 25 of 500

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