Skip to content

Tag: bash

Set docker image username at container creation time?

I have an OpenSuse 42.3 docker image that I’ve configured to run a code. The image has a single user(other than root) called “myuser” that I create during the initial Image generation via the Dockerfile. I have three script files that generate a container from the image based on what operati…

PHP exec() not grabbing output from bash command

i’m trying to get the ouput from a bash command. If I execute the some command directly in the bash, i see the result. But not with PHP exec() function.. This command try to get a video resolution using ffmpeg lib. The video path it’s fine, I triple check that. Thanks! EDIT: screenshot from the ou…

Shellscript If statement returns error

I am trying to check if a file is older than 5 minutes and if that is the case I want to call another shell script which sends me a mail. check_file.sh: Error output: 3: ./check_file.sh: [1]: not found Answer Try something like:

rrdtool graph: one graph line plotted incorectly

I’m trying to keep track of the CPU temperature and usage and then create a graph with the values. I used the rrdtool to store and create the graph. Here is the command I used to create: then to insert values: if I query the data, it looks like this: To create the graph I use this: The temperature line

How to have simple and double quotes in a scripted ssh command

I am writing a small bash script and want to execute the following command via ssh Unfortunately this command contains both simple and double quotes so I can’t do What would be the recommended way to solve this issue ? Answer Using a heredoc You can just pass your exact code on the shell’s stdin: …

/etc/fstab: parse error: ignore entry at line

I have scrip with function: After execution – mount returns me an error: root@xx255rs2sptry000001:~# mount -a mount: /etc/fstab: parse error: ignore entry at line 9. Same error if I’m trying to sed manually: I tried to close variables in “” – but no luck: echo “//$STORAGE_N…