Search Results

Search: Posts Made By: wanderingmind16
3,055
Posted By MadeInGermany
Linux: $ /usr/bin/printf "%05s\n" 123 ...
Linux:
$ /usr/bin/printf "%05s\n" 123
/usr/bin/printf: %05s: invalid conversion specification


---------- Post updated at 09:12 ---------- Previous update was at 08:11 ----------

Perhaps you...
3,055
Posted By Don Cragun
If you save the following in a file named tester:...
If you save the following in a file named tester:
#!/bin/ksh
width=${1:-5}
printf '%s\n' 123 12345 12345678 "" S12 | awk -v w="$width" '
{ if((len = length($1)) >= w)
printf("%s\n", $1)...
3,055
Posted By Don Cragun
As I mentioned in post #3 above, this is not...
As I mentioned in post #3 above, this is not surprising. You will probably also find the same difference in the printf family of functions in libc on those systems (for C and C++ programs using...
3,055
Posted By Don Cragun
The standards describe the 0 flag in generic...
The standards describe the 0 flag in generic printf format arguments as follows:

Since the s format conversion specifier is not in the above list and the awk printf function description does not...
3,055
Posted By vbe
Yes... like most gcommands.. gnu version often...
Yes... like most gcommands.. gnu version often offers more options and so behaviour may not be like standard UNIX commands, think of gtar etc...
1,722
Posted By Scrutinizer
Your temporary filesystem appears to be too...
Your temporary filesystem appears to be too small. You can specify an alternative location with sort's -T option...

... or try something like this:
awk -F\| 'NR==FNR{A[$1]; next} $1 in A' R1 R2
1,722
Posted By Scrutinizer
Hi, Join needs the default sort order, not a...
Hi,

Join needs the default sort order, not a numerical one.. Try this if you are using bash / ksh93:
join -t \| <(sort -t\| -k1,1 R1) <(sort -t\| -k1,1 R2)
7,052
Posted By elixir_sinari
It will not. awk 'BEGIN { CONVFMT="%-20.6f" ...
It will not.
awk 'BEGIN {
CONVFMT="%-20.6f"
a=19
b=20.5
printf ("a = %s\n",a)
printf ("b = %s\n",b)
}'

a = 19
b = 20.500000
Integers get converted to strings as integers, irrespective of...
7,052
Posted By zaxxon
Use f instead of d in printf which stands for...
Use f instead of d in printf which stands for "floating point".
1,533
Posted By itkamaraj
BashFAQ/082 - Greg's Wiki...
BashFAQ/082 - Greg's Wiki (http://mywiki.wooledge.org/BashFAQ/082)
1,533
Posted By balajesuri
See if this gives any information you're looking...
See if this gives any information you're looking for:
Useless use of backticks. (http://partmaps.org/era/unix/award-example-backticks.html)
2,694
Posted By Scrutinizer
Hi, try: sort -t \; -k3.2,3.3rn infile | awk...
Hi, try:
sort -t \; -k3.2,3.3rn infile | awk -F\; '!A[$4]++'
Make sure there are not spaces in the input file.
2,694
Posted By rangarasan
awk
Hi,

Try this one,


awk 'BEGIN{FS=";";OFS=";";}{split(/\;/,a,c[$4]);if(a[3] < $3 ){c[$4]=$0;}}END{for( i in c ){print c[i];}}' file


Cheers,
Ranga:)
Showing results 1 to 13 of 13

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