About 13,600 results
Open links in new tab
  1. bash - Printf formatting with variable format - what does this var ...

    Mar 24, 2015 · The simplest form for the field width specifier is an integer: this asks printf to use at least this many characters for printing. If the corresponding parameter requires fewer …

  2. Using printf with AWK to format my output correctly

    Apr 16, 2021 · I'm trying to format some output using printf with awk. Basically, I want the final format to look like this (everything is tab-separated.) chr10 100000624 100000625 …

  3. Where to find printf formatting reference? - Unix & Linux Stack …

    Where is the offline reference of the format specifiers (e.g., %i, %s) which are supported by the Bash/system printf command? I've looked in help printf, man 1 printf and man 3 printf without …

  4. printf outputs rows, not columns - Unix & Linux Stack Exchange

    Apr 4, 2019 · 1 Your format specifiers don't match up to the number of elements present in each array. Once your array expansion happens, there are multiple words generated each needs a …

  5. Printf formatting a ZSH variable without forking?

    Apr 3, 2022 · The printf utility in both bash and zsh has a -v option that allows you to "print into a variable": printf -v MYEPOCH "%'d" ${EPOCHSECONDS} The actual result of the above …

  6. Does printf have an "engineering" notation format for numbers?

    Sep 28, 2017 · 7 Say I have this number: 105000000, in this form I can't easily see how big it is, so using printf at a prompt I try using the "scientific" notation: % printf "%.3E" 105000000 …

  7. How to correctly format the output with Awk printf command?

    I am trying to format this file using awk printf to have the following desired format: keep the same order of fields (left-->right) have comma ", " FS only for the l ast three fields ($5, $6, $7) having …

  8. bash - printf - store formatted string output in a variable - Unix ...

    May 9, 2024 · Notice I get two newlines -- one from the printf format, the other from the echo. You could also control the column widths using something like $-10s for each field, instead of tabbing.

  9. Using echo or printf to print out new line and carriage returns as …

    Jun 16, 2021 · print them out how? if they're in variables, echo and printf would by default print them out quite literally, as the actual CR and LF characters. Is that what you want, or do you …

  10. printf format depending on number of parameters

    Jul 6, 2021 · I am writing a bash function that takes a number of strings, with each string to be printed it a separate line. But have to compose the frmt variable to printf appropriately …