Skip to content
Advertisement

Tag: scripting

Using find to rename files recursively with random chars

I have an IP camera that takes snapshots and nests those snapshots into multiple directories. The sub directories look something like this. There is a ton of sub directories because of the way it stores files since it places those snapshots within a Minute directory of the Date/Hour directories. At any rate, there are other types of files mixed in,

python filter lines matching keyworks

I have working python script producing following output. Script output Now i want want any line starting with stream in output so i am using following logic but its not working. Answer Your data is a massive string instead of a list of strings as you expected. Also it’s easier to use str.startswith instead of regex (less resource hungry). Simply

How to access specific path in linux using shellscript

Let us consider an example, scriptPath=/home/sharath/Downloads/Atollic_TrueSTUDIO_for_STM32_9.2.0_installer In the above line of code, If user is “sharath” then he can access a file/folder same way if the user is different how can access that folder/file dynamically. below is my shellscript(.sh file): In last line of the script, ${scriptPath} is diffrent for diffrent user, how can handle in shell script. Update 1:

Bash Scripting checking for home directories

I’m trying to create a script to check if user accounts have valid home directories. This is what i got at the moment: This works. I get the expected output which is the username of the account with an invalid home directory. eg. output However, I am unable to make it so that ONLY if there is no issues with

Extra percent sign appears in echo bash

I’ve got the following script below which is supposed to demo CPU utilization: For some reason, when the percentage is echoed out, two percent signs appear instead of the last digit of the number and a percent sign. For example, the output is sometimes 2.7%% instead of 2.72%. Everything works fine when I take the percent sign away, but even

Advertisement