Questions tagged [null]
For questions on how programs deal with the NULL character ("\0" or "0x00"), or the special "/dev/null" device to which program output can be redirected so that it disappears.
57 questions
3
votes
2
answers
345
views
Programs to visually verify the placement of null bytes by grep [duplicate]
I have been using the grep command with --null.
grep --null -r -n -- "$pstr" "$pdir"
The man page for my version of grep (on Mac OS Sequoia) says:
--null Prints a zero-byte ...
1
vote
1
answer
186
views
exim error: NUL character(s) present (shown as '?')
I'm getting the NUL character(s) present error on exim, similar to this post, but since that post is too old, I'm following Charles Davis suggestion to create a new question.
$ tail -f /var/log/exim4/...
2
votes
4
answers
2k
views
How to POSIX-ly ignore "warning: command substitution: ignored null byte in input"?
Today, I was working with my Raspberry Pi 4 with Debian 12 Bookworm, and I found it odd, that some system text files, namely I needed these two:
/sys/firmware/devicetree/base/model
/sys/firmware/...
1
vote
1
answer
574
views
Error redirection fail with bind - dig
I'm trying to test some nameservers against a domain name.
For that, I created a script that reads a list of nameservers and asks for a domain name.
Something basic like this:
#!/bin/bash
domain=$1
[ ...
3
votes
4
answers
1k
views
Empty string breaks command line
I am having trouble trying to describe my issue. Please bear with me. I have a script that calls a command. I need to optionally include an extra argument in the command line depending on the input ...
0
votes
1
answer
457
views
Trying to rotate logs however tee command fails to return after execution
My logs nohup.out is owned by root user while I m trying to rotate the logs using system which has privileged access using sudo
I have written the below script to rotate logs.
cat rotatelog.sh
cp /var/...
0
votes
1
answer
329
views
Why is /dev/null needed to run asynchronous jobs in busybox sh?
I'm curious why this special device is needed to fork the command and run it asynchronously in the minimal Busybox shell.
BusyBox v1.30.1 (Debian 1:1.30.1-4) built-in shell (ash)
Enter 'help' for a ...
1
vote
0
answers
388
views
How to suppress php output in one-line chained terminal command
I use the following &&-chained one-line command in Linux terminal (Ubuntu desktop):
cd /opt/lampp/htdocs/detailed_payouts && for FILE in *; do dos2unix $FILE; done && php /opt/...
-1
votes
1
answer
135
views
Can any one explain what the purpose of this "dd" command that writes to /dev/null is?
dd if=/dev/sda7 of=/dev/null bs=1024 skip=276892816 count=420 iflag=direct
We are having some issues backing up a Linux server. Anyone, please explain to me what this command does in that case.
...
0
votes
0
answers
711
views
"> $logfile" does not truncate, file size goes to 0 and a second later, is back to full size [duplicate]
I have a script that writes to a logfile like this:
$ nohup myscript.sh > myscript.out 2>&1 &
when the log file gets very large, I need to truncate it like this:
> myscript.out
I ...
6
votes
2
answers
20k
views
How do I make Bash not drop NUL bytes on input from command substitution?
I have this Linux shell command:
echo $(python3 -c 'print("Test"+"\0"+"M"*18)') | nc -u [IP] [PORT]
My intention is to pipe the output of the print statement to the ...
3
votes
1
answer
1k
views
awk with null record separator printing just one file
How does the following code print just a single file?
find "$fdir" -type f -name "${fnam}-*.png" -print0 | awk -v RS='\0' -F'[-.]' '{print $(NF-1), $0}' | cat -vet
which gives me
...
0
votes
1
answer
1k
views
null characters at the beginning of an ASCII log file
We have an java application that log4j2 to generate log file and have script to stop the process before restart it with another script. There is 5 minutes pause between stop and restart at the ...
1
vote
0
answers
261
views
How do I set up null-sink and capture to route audio into camilladsp?
I am trying to set up an assistant on my raspberry pi, but I need the audio to route through camilladsp before it's outputted to my DAC. I figured a pulseaudio null-sink and null-sink capture would be ...
1
vote
1
answer
164
views
How to empty a file with terminal?
All my sites include a script that saves in a file all the fake google IPs that are not in google IP range.
Then with a script once a day I add all the IPs to the firewall.
while read line; do sudo ...