Skip to content

Tag: shell

What is text syntax in ImageMagick

I use following code convert text to image what is x, y means in text x, y ‘string’? Answer Method 1 label: You can either use label: which provides a canvas large enough to hold your text – notice I didn’t provide a canvas size: Method 2 -annotate Or, you can use -annotate to write on…

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…

Converting watch into a unit file systemd

I’ve got a shell script as follows ss.sh The requirement is that I need to use this script with the watch command. And I’d like to make this into a systemctl service. I did it as so. sc.sh And in my /etc/systemd/system, log_info.service When I run systemctl start log_info.service, It runs but not …

grep multipe wildcards in string

Say I have a file that contains: I want to grep and match lines that only contain ‘package’, ‘el6’, and ‘x86_64’ How would I go about doing that on a one liner using grep? The line must match all three and grep shouldn’t care about how many characters are in between. …

how to calculate percentage in shell

I would like to calculate percentage in shell. But I can’t do it. My script is It is neither showing any value nor terminating when executing this script. Answer awk will give you an n1 illegal field name if you do that, as it’s inside single quotes. Also, to avoid awk keep reading stdin you shoul…

Automation of networks using ansible on openstack

I’ve written an ansible script, to create a network based on a condition. So that, even if I run ansible script again it will not create duplicate entries in my openstack environment. task: I don’t have either of the twonetworks in my project. My intention was, both the statments display null outp…