Skip to content
Advertisement

Serial socket – ignore POLLHUP received in non-canonical mode?

I have a Raspberry Pi connected via UART to a microcontroller. The code on the RPI is trying to read incoming non-canonical UART data, but randomly receives POLLHUP. I have been able to recover by closing and reopening the file, but this is less than ideal. Is there a way to disable the disconnect detection behavior of termios in Linux?

How to omit the result after I get the result in Linux?

I am writing a code using Linux. I used the ‘until’ function to find my file however I am unable to remove the result once I found it. Any guidance? My code: Result: Answer The output you are trying to discard is coming from find. Either redirect it to /dev/null, or use:

how to for loop a jq array result in shell script

I have a json data as below now I can use below command line to get a list containing two dict, each dict have a key “data”, value is a list, I want to print each dict with a loop in shell script My except in each loop have printed a dict, total have 2 dict But it seems like

DFU not transferring data in barebox

Am working on a custom board – has no removable storage (sd) and only one UART. I need to transfer files on the the QSPI storage using barebox bootloader. I am trying to use DFU to transfer various files to write to QSPI Device tree has the follow among other things On the board, the OTG mode has been set

Show mtime of a file in another branch

Using git ls-files –debug or stat command, you can see the mtime (last modified time) of a file in a current branch (strictly in a current commit). Then is there any way to see this information for the same file in another branch (another commit)? Workarounds Currently I have two workarounds, both of which I don’t think are beautiful solutions.

-RPATH preference not working when executable run with SETUID set

Little bit of background: I have a execuatable which requires admin-privileges to run. This executable also has a runtime dependency on a custom dynamic lib. That dynamic lib has to be loaded from a custom path (and not from /usr/lib because a similar old version of this executable is present on which other libs may be referring to) which the

remove comma in jsonpath template using bash

I have a JSON path template query. i’m redirecting it to csv. getting comma in a message from above output , i want to replace the comma with space for the second column(message) in the bash script. Anyone has any thoughts on how can achieve this. Expected result Answer Assuming you can change the field delimiter to a character known

how to write Bash script for getting Public ip address in a way that when one command failed then it have to execute another command

i want to write a bash script in a way that if one command gets failed then it will have to execute another command. For example:- “curl www.ifconfig.me” if this command gets failed then another command “curl http://icanhazip.com” to get execute and should show the output. Answer If you want the HTTP code, try this: Then: After that, you could

Advertisement