Skip to content

Tag: bash

Strange output in shell script

I’m encountering a very strange thing while writing a shell script. Initially I have the following script. When I ran this script, every 60 seconds, I’ll see the $DATETIME,$FIELD1 values in my log file. What is very strange, is that every 30 seconds or so, after the first minute has passed, I&#821…

how to replace decimal in linux

I have a csv file with error in one field, the fields are separated by “,” but the error is in decimal field, for example 34.25,” i need replace by 34.25″,”. Search ,” and replace by “,” is not option, others fields will modified. Answer Check that the character…

Using grep and * to get the exact file name

I have following heapdump files now if I use I get following output But I use I get no output. Could anybody help where is my mistake and how to search the heapdump files. My expected output is should give me due to some reason I could not use Answer It looks like you’re confusing glob patterns with reg…

How to restrict a particular command in bash?

I have bash-3.2.tar.gz I have all the tools needed to compile the bash. Now I need to restrict a command in the compiled bash binary, e.g. I want to restrict the command “kill” in the compiled bash binary. How to achieve this? Thanks in advance. Answer It’s not clear exactly what you’r…