Skip to main content

Questions tagged [printf]

The shell builtin command that formats and prints data. Questions that deal with printf command or broadly using printf syntax by programming language (like awk, PHP, perl, C++...)

1 vote
2 answers
143 views

It's often that when I am in a subject involving many processes of two or three kinds, I'm noticing that: one terminal I've opened is dedicated for my subject of kind #1, while another is opened to ...
Marc Le Bihan's user avatar
1 vote
1 answer
79 views

I'm surprised by the difference in manipulating the array between echo and printf in Bash: printf cannot handle += operator Both printf and echo cannot get results of += out of while loop So, why? I'...
Keelung's user avatar
  • 167
0 votes
0 answers
35 views

When I execute the c file #include <stdio.h> #include <stdlib.h> int main(){ printf("before the system call. I am too excited!\n"); system("ps"); ...
KeShAw's user avatar
  • 23
-1 votes
1 answer
137 views

We are in a concurrent scenario where we have n concurrent processes. By using a synchronization policy (e.g., using pipes or signals), each process can print using printf("string\n") only ...
Spartacus's user avatar
0 votes
1 answer
68 views

In Linux in Bash in a for loop i do: ... ; do echo "$i --> $i-new" ; ... The output is than something like this: file1 --> file1-new file2 --> file2-new ... file9 --> ...
user447274's user avatar
0 votes
0 answers
44 views

With version GNU bash, version 5.2.32(1)-release (x86_64-pc-linux-gnu) in present Debian testing this command: $ printf '%010f\n' '1234' 000.000000 Doesn't use the number given and changes on every ...
smf's user avatar
  • 1
5 votes
1 answer
492 views

In Zsh 5.9, we can use printf to shell escape a string: $ printf '%q' 'One! Two' One\!\ Two This produces the correct output of escaping the ! and the space. Now let’s make it as a script: #!/bin/...
user137369's user avatar
1 vote
1 answer
594 views

How do I get printf to output hex characters when run from a script? Suppose I am at the prompt and type printf "\x41\x42" the output I get AB% However if I have a script containing that ...
sgmoore's user avatar
  • 135

15 30 50 per page
1
2 3 4 5
20