I have a script that I would like everyone (world) to be able to execute. However, one line in the script requires root privilege to run properly.
How can I make this script work for everyone, without requiring anyone to enter root credentials? If I preface the command with sudo then I assume every users will be prompted for root credentials.
#!/bin/bach
echo "works fine"
sudo rootonlycommand
echo "works fine"