It is seems to be an easy question, I wonder why googling didn’t give anything helpful — nor in StackOverflow, nor in tutorials. I just need to check using bash that a condition is false. Of what I found I tried and none of them print Hello. I found only two similar questions, but the end answer i…
How to invoke webbrowser from cgi script?
My cgi script is as follows on a Linux system with Firefox and Chrome browsers: Assume that it is a PDF file only. I need to display image files also in a browser. Not able to trace the bug. Answer I edited my code to work this way:
Check for substring in Shell without Bashisms
I’m trying to write a shell script, and in it I have to look for the presence of -32 in a string. Unfortunately I have to do it without using any bashisms as it has to run on computers running Dash. I tried case ${1+”$@”} in *-32*);; but that will pick up something like -321. Is there a way …
How to find from where a job is submitted in SLURM?
I submitted several jobs via SLURM to our school’s HPC cluster. Because the shell scripts all have the same name, so the job names appear exactly the same. It looks like How can I know from which directory a job is submitted so that I can differentiate the jobs? Answer You can use the scontrol command t…
Bash No such file or directory error
When I do It works fine. But when I do the same thing with I get ~/Desktop/out.txt: No such file or directory. Why? Answer Take the tilde out of the quotes so it can be properly expanded: You can also use ${HOME} if any subsequent part of your path contains spaces and you want to quote the whole path:
Can’t run c/c++ codes in code::blocks 13.12 on linuxmint 17: Status 255
I am not able to run any C/C++ programs in code::blocks. Could anyone please suggest why this is happening? Currently I have the gnu c and g++ compilers installed on the system. The error message on building and running this simple c code: is: Checking for existence: /home/user1/Desktop/progs/a Executing: xte…
Extract section of xml from result of curl command on Linux
I am issuing the following command: Which returns xml that looks similar to this: What is the easiest way to extract an xml element from the response, e.g. the element “true”? Note, I want the complete opening tag, content, and closing tag (and the content may also be empty. Thanks Answer Would xm…
Bash script to install AWS CLI tools
I am writing a bash script that will automatically install and configure AWS CLI tools. I am able to install AWS CLI tools but unable to configure it. My script is something like this: I wish to do the configuration using this script too. I wish that I can provide these credentials via script so that it preve…
Use Bash variable within SLURM sbatch script
I’m trying to obtain a value from another file and use this within a SLURM submission script. However, I get an error that the value is non-numerical, in other words, it is not being dereferenced. Here is the script: When I run this as a normal Bash shell script, it prints out the number of procs correc…
GNU Radio & Python script: “shmget (2): No space left on device”
I currently have the following error when running a Python script with gnuradio 3.7 blocks: I have followed the lines as suggest here: http://osdir.com/ml/discuss-gnuradio-gnu/2013-06/msg00521.html and changing the kernel.shmall and kernel.shmmax values. But what are acceptable values? I have increased them 8…