Statusbar for progress of bash script
I would like to know if there is a soulution for having a statusbar or something like this, to track the progress of my shell script ?
I appreciate any useful answers
See also questions close to this topic
Pam authentication not being applied for non root user in ubuntu
I created .so file which print "welcome to .." to shows a welcome message when user connect with other user using openssh.
I also gave the reference into "/etc/pam.d/sshd" file and "/etc/pam.d/common-auth" same as google authenticator.
When I begin any command with "sudo" word my "welcome to .." message shows.
So now i want that welcome message print when any user(non root = does not start command with sudo) which work under the admin when try to entering a password it will print welcome message.
Please give response as early as possible. Thank you.
How to get a full path to a file by name in Linux
I was given a task to write script that works similar to "which" command in terminal. Here is what I already wrote:
#! /bin/bash FILE=$1 for i in $PATH do if [[ "$i" -eq "FILE" ]] then echo …
Here I need to get a full path to a file that has been found. How could i get it? Thanks in advice.
conda can't find cv2 lib located at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so
I have compiled opencv from source and used following flag to install it in anaconda lib path
-DCMAKE_INSTALL_PREFIX=/opt/conda -DCMAKE_BUILD_TYPE=Release (blah blah)after running
make installthe opencv lib gets installed at
/opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.sowhich is a bit strange as I was expecting to be installed in
/opt/conda/libdirectory. More importantly when I try to do
import cv2inside python terminal, I get a
ModuleNotFoundErrorerror. OpenCV is also not showing in
conda list. Am I missing something here? Where should OpenCV be installed to get it imported in Ananconda ?
For completeness my
PATHare given below:
Shell-Script: Get cURL error, if wrong user
My shell script looks like this:
#!/bin/bash curl -f -T /home/skript_1.txt -u XXX:XXXXXXX! -k http://192.168.0.100/home/test.txt res=$? if test "$res" != 0; then echo "the curl command failed with: $res" else echo "Success $res" fi
I use this to ulpad a file...
Now my problem is, that I can't get all errors. As an example if I enter a wrong URL (the right URL would be http://192.168.0.100:5005/home/test.txt), the upload fails, but the exit code still is 0.
Here is the output with a wrong URL:
<html> <head><title>302 Found</title></head> <body bgcolor="white"> <center><h1>302 Found</h1></center> <hr><center>nginx</center> </body> </html> Success 0
How can I get those errors as well?
I also tried the same thing with cURL and and ftp target, there it works with all errors.
Bash: How to check if an user exists?
I'm making a script that add an user, deletes an user and change password of an user passed as parameter ($1). I want to check if the user exists, so I can control this better. I know this question have been asked a lot of times, I've been googling this before, but really, these solutions didn't work for me, I don't know which is my mistake, so sorry.
This is my code:
#!/bin/bash existe=$(grep -c '^$1:' /etc/passwd) if [ $existe -eq 0 ]; then echo "The user $1 exists" echo "" else echo "The user $1 does not exist" echo "" fi
I've tried the ">/dev/null" solution, the "getent" thing... Agh... No matter what I do, the user always exists, and the code I pasted here is the last one I was trying.
Can you help me? ^^ Thanks in advance.
Copy a specific directory with irregular structure in bash?
I have some files to copy (directory with files). How i can copy a specify directory in Linux?
My directory structure is like that:
How i can copy a directory "copy_dir" from userX? Some users have a directory with multiple use1_dir, where is a copy_dir.
home | |----usr1 | | | |--dir1 | |--dir2 | |--files_dir | \ | user1_dir | \ | copy_dir | | |----usr2 | | | |---dir1 |---dir2 |---dir3 |---dir4 |---files_dir | use1_dir | \ | copy_dir | use2_dir | \ | copy_dir | use3_dir \ copy_dir
How to hide Status bar programatically(swift) in a specific view controller?
Show/Hide Status bar using key-value of
UIApplication.shared. I have tried Overriding method
prefersStatusBarHiddenbut it didn't get the result.
How do I change the colour of status bar by java codes
I want to change the colour of status bar by java codes when changes App theme immediately... But I don't know do it! Help me, please.
Navigation Bar and Status Bar colors/ invisible iOS
I'm trying to realize navigation bar and status bar that take colors of the image on top of controller. I've try with this two code:
self.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationBar.shadowImage = UIImage()
but it change only the main controller and I need to make invisible only the second controller not the main. Here is an image of what I want exactly. Thank you enter image description here