10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am running a bash script to do an rsync back on a computer running MacOS High Sierra. This is the script I am using,
#!/bin/bash
# main backup location, trailing slash included
backup_loc="/Volumes/Archive_Volume/00_macos_backup/"
# generic backup function
function backup {... (12 Replies)
Discussion started by: LMHmedchem
12 Replies
2. Shell Programming and Scripting
The below bash does not seem to exit if the user response is n N no No. Is the synatax incorrect? Thank you :).
Bash
read -r -p "Is this correct? " response
if ]
then
echo "The files do not match" && exit ;;
else
.... do something
fi (5 Replies)
Discussion started by: cmccabe
5 Replies
3. Shell Programming and Scripting
Heyas,
Since this question (similar) occur every now and then, and given the fact i was thinking about it just recently (1-2 weeks) anyway, i started to write something :p
The last point for motivation was... (17 Replies)
Discussion started by: sea
17 Replies
4. Shell Programming and Scripting
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies
5. Ubuntu
I'm writing a bunch of scripts to automatically configure Ubuntu and I want to run the code below to remove the white dots from the login screen:
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false
The problem is that... (3 Replies)
Discussion started by: maerlyngb
3 Replies
6. Shell Programming and Scripting
I have a script with a whole lot of different functions and want to set teh script so that at any point a key or series of keys can be pressed to exit out and into the main menu function. Rather this than endlessly creating, 'Return to main' menus.
Something along the lines of Ctrl+q for example... (1 Reply)
Discussion started by: 3therk1ll
1 Replies
7. Shell Programming and Scripting
Here is my daily stupid question:
How can I tell a script to only execute if the other scripts exits successfully?
So "script A" executes and it executes successfully (0),then "script B" will run
or else
"script A "executes and it exits unsucessfully (1) then "script B" will read return... (6 Replies)
Discussion started by: metallica1973
6 Replies
8. Shell Programming and Scripting
Solved Stupidly I didn't put brackets around the , thanks for all the help guys
if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null -- fails
(if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null) --works (3 Replies)
Discussion started by: danmc
3 Replies
9. Shell Programming and Scripting
Hello
Okay, for reasons related to sourcing a script from another script, I've had to put my main loop into a function, and from there I call other functions. My problem then is exiting from deep within the function call stack.
I used to simply call exit, and that would accomplish what I... (1 Reply)
Discussion started by: brsett
1 Replies
10. Shell Programming and Scripting
This is a very simple problem, I am wondering why I can find no answer anywhere...
I have a script that can be run either sourced or not. This script has some place where it needs to quit execution (e.g., when an error is found)
If I "exit", the sourced call would exit the parent shell, but... (7 Replies)
Discussion started by: MadMage
7 Replies