#!/bin/bash
a=(sd fd dir)
b=(storage file director)
for k in "${!a[@]}"
do
echo "restarting bacula ${b[k]} daemon"
/sbin/service "bacula-${a[k]}" restart
echo
done
More Related Contents:
- Make Bash handle variables like Batch
- Some troubles with using sed and awk [closed]
- Why would a correct shell script give a wrapped/truncated/corrupted error message? [duplicate]
- Delete all but the most recent X files in bash
- Add a new element to an array without specifying the index in Bash
- Batch equivalent of Bash backticks
- How to find the difference in days between two dates?
- Lookup shell variables by name, indirectly [duplicate]
- How to assign a heredoc value to a variable in Bash?
- Running script upon login in mac OS X [closed]
- Command substitution: backticks or dollar sign / paren enclosed? [duplicate]
- How do I use su to execute the rest of the bash script as that user?
- How to iterate over associative arrays in Bash
- How to process each output line in a loop?
- How to extract one column of a csv file
- bash: force exec’d process to have unbuffered stdout
- Set a parent shell’s variable from a subshell
- Find and replace filename recursively in a directory
- What does it mean in shell when we put a command inside dollar sign and parentheses: $(command)
- What is the ‘function’ keyword used in some bash scripts?
- How does bash tab completion work?
- How to add leading zeros for for-loop in shell? [duplicate]
- How to silence output in a Bash script?
- How to tell bash that the line continues on the next line
- Bash script store command output into variable
- Syntax for a single-line while loop in Bash
- How to use > in an xargs command?
- Unit testing Bash scripts
- How to zero pad numbers in file names in Bash?
- Groups of compound conditions in Bash test [duplicate]