I have used watch and tail together like this: Also I have used tail and ccze for colorizing log file as below: But I dont know how should I use all of these three together in a single command. Does any one have any idea? Answer Recent versions of watch has -c | –color option, so perhaps this will work
Tag: bash
Bash: Sort text file by bytewise case sensitive sort command or using python sort command
Text File using sort -s (case sensitive) using sort -f (Not case sensitive) The words starting with an uppercase are sorted alphabetically between the lowercase words. What I want is that the words in uppercase are at the start of each next letter (upercase alphabetically sorted): Expected output: How can I r…
Concat multiple (self-generated) videos using ffmpeg on raspbian linux
I am a very talented sleep talker, so I decided to write a solution that records the things I talk at night to make funny videos with subtitles of it. The project is nearly done, but I got a big problem with concating videos I generated before. The video parts are generated from single png frames using this c…
Difference between printf and echo in Bash
Why printf prints 5 and echo prints 6 characters? Answer First sentence of entry for echo in the bash man page (emphasis mine): Output the args, separated by spaces, followed by a newline. First sentence of the man page entry for printf: Write the formatted arguments to the standard output under the control o…
How to write a bash script which automate entering “docker container” and doing other things?
I want to implement an automatic bash script which enters a running docker container, and do some stuffs: Executing the script on terminal: The output shows only login the docker container, but won’t do other operations. Is there any method to automate entering docker container and doing other things? A…
Unexpected EOF while looking for matching `”‘ shell script
I get when I try to run a shell script that I made, but I don’t see any misquotes on lines 36-38 SCRIPT: Answer Fix escaping of ‘: replace all ‘ by ”’.
XSLT: add element, read content from file
I ran into a complicated XSLT question. Input.xml Here I want to add a new element <DESCRIPTION>. The tricky part: the content are in separate files, the file name of the description file is the : (00050802.html,00033802.html === <ID>.html). The .html contains some html code, so the content should…
How to put an executable script on the background and wake it up after x minutes
I’m developing a timer in bash and this is what I’ve come up with so far: It works like I was expecting except that I have to wait the X minutes I passed as input to get the prompt back. Any ideas how I can execute this and have it execute it in the background so I can keep working
Commands terminated with the same char
How can I fix the follow line: The problem is that the commands of for and -exec end with a semicolon, the for command has this statement and find statment with -exec Answer You don’t even need to use -exec echo {} since that is default action in find. You can use this for loop: There is no need to
pass commands server using perl openssh
there are 2 systems, client system, in which i am passing commands to the server by doing openssh to the server and my script goes like this and in server /p/inway/bin/inway71 is a scripts: so when i login to my server and run this script in my terminal, i will be directed to some path (i have no clue what