Skip to content
Advertisement

Tag: terminal

Unable to get the absolute value of command output

So I wanted to make a simple script to keep checking the CPU temperature of my RasPi, which is stored in /sys/class/thermal/thermal_zone0/temp , and hence cat /sys/class/thermal/thermal_zone0/temp would give the temp, but like this : which essentially means 38.459 degree Celsius. I was unable to format the output to get 38.594 °C My code: The error I get: Thanks Answer

Extract all unique URL from log with only POST type of the request

I’ve got a log file with the such type of the records: 41.201.181.27 – [2019-04-06 18:22:02] “GET /images/stands/photo_mois.jpg HTTP/1.1” 304 – “http://example.com/popup.php?choix=mois” “Mozilla/4.0” “-” I’ve got the script for getting all records with unique URLs: cut -f4 -d” < logfile | sort -u How i need to change it for getting unique URLs with only POST type of the request?

Setting signal for SIGWINCH causes output on terminal?

When I set up a signal handler for SIGWINCH that does nothing, resizing the terminal window causes a reverse ? character to show up, get several of them as I resize the window around. If I don’t setup a signal handler, that doesn’t happen. Why is it doing that and How do I stop that? More information: I dump what

how to avoid enviroment variable from resetting in WSL terminal after restart?

environment variable set (in zsh shell) in WSL disappears after restarting the terminal. I have used to set environment variable. how should I avoid env variable from resetting after restart. Answer I added environment variable in .zshrc file after reading comment of @Biswapriyo. like this- export variable_name=variable_value and now it works. I think, at every startup, scripts in .zshrc file

Advertisement