I am using c++ and setenv to set a variable like in this program below: The output I get is “TEST=$HOME/test”. However I want the output be like “TEST=/home/toboxos/test”. I found nothing using the linux manual. Is there any function resolving the environment variables or have I to do …
Tag: linux
how to search a file only in user profile and root in linux/unix [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
The use of const char* vs. string literals
I’m using an external Modbus library – written in C – to connect to a microntroller Modbus slave from a Linux machine, using a serial connection. I’m also using wxWidgets to create an application on the Linux machine, which runs a Modbus master in the background. One of the Modbus func…
Makefile generate numerical list of files
I have a Makefile that I use for building a book I am writing into EPUB and Kindle formats. However, my list of source files is getting really long: I am trying to generate this list programmatically, and I got it working with: But can’t help but feel I feel like there is a simpler way. Is there a simpl…
Package import error when running Python 2 app on Azure App Services
The application works fine on my local linux server but I have trouble of running it on Azure. I checked the Files folder and all python libraries are installed correctly under /antenv2.7/lib/python2.7/site-packages. Here is my pip requirements file: But when gunicorn starts, it generates this error. I don…
updating nodejs on linux (yocto) using npm
I need to update my nodejs on a linux-Yocto OS, using npm here what I’ve tried : Does anyone know what I’m missing here ? thanks in advance ! Answer Sounds very much like this n thing relies on the node binary being located at /usr/local/bin/node, which does not hold true for a distribution level …
Script exits with error when var=$(… | grep “value”) is empty, but works when grep has results
I have the following bash code (running on Red Hat) that is exiting when I enable set -o errexit and the variable in the code is empty, BUT works fine when the variable is set; the code is designed to test if a screen session matching .monitor_* exists, and if so do something. I have the following turned on: …
How to run python code from linux via a docker containing a specific python version
I have a linux server running in which I want to be able to run some python scripts. To do so, I created a docker image of python (3.6.8) with some specific dependencies to run my code. I am new to linux command line and need help on how to write a line that would run a given python script
Why decrement of variable inside loop returns no success status code?
I can’t understand why inside loop with condition of equal to 0 decrementing of variable returns non-zero status code (not success) if variable was decreased to 0? If I use a different condition for the loop – for example – until [[ $RETR -eq 1 ]] it returns 0 status code after last decreasi…
Using find to rename files recursively with random chars
I have an IP camera that takes snapshots and nests those snapshots into multiple directories. The sub directories look something like this. There is a ton of sub directories because of the way it stores files since it places those snapshots within a Minute directory of the Date/Hour directories. At any rate, …