I have a bash script from which I want to access /dev/tty, but only when it’s available. When it’s not available (in my case: when running my script in GitHub Actions) then when I try to access it I get /dev/tty: No such device or address, and I’m trying to detect that in advance to avoid th…
Tag: 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 s…
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 wh…
-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 l…
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…
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 yo…
running buildroot as root. still error after setting FORCE_UNSAFE_CONFIGURE=1 in environment variable
I am trying to run buildroot with root user. Even after setting FORCE_UNSAFE_CONFIGURE=1 as export FORCE_UNSAFE_CONFIGURE=1 I still get configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check). When I try to run buildroot without root user I get…
Yocto boot partition vs boot rootfs directory
I need to mount my boot partition in order to perform software updates in my yocto built. I would expect to mount it in /boot but I see that there is a directory there already I cant seem to find information about what this /boot directory is and why its needed. It contains the same .itb file that is in