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 …
Tag: linux
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…
what is the correct com.skype.* usage with Linux?
On Linux (Ubuntu 14.04), this code hangs after “got contact list” is printed: Examining the library, com.skype.connector would seem to use JNI to connect with Skype. At least for me, the connection never seems to occur. Is it even possible to use this to connect to skype? How do I know why why it&…
How do I do a one way diff in Linux?
How do I do a one way diff in Linux? Normal behavior of diff: Normally, diff will tell you all the differences between a two files. For example, it will tell you anything that is in file A that is not in file B, and will also tell you everything that is in file B, but not in file A.