Old thread, but what about:
echo 'foobar ALL=(ALL:ALL) ALL' | sudo EDITOR='tee -a' visudo
More Related Contents:
- Use sudo without password INSIDE a script
- create a file with prefix =file1 followed by the random number
- Why to code a script which will check if some package is installed in linux and if not then install it?
- How do I use sudo to redirect output to a location I don’t have permission to write to? [closed]
- How to pass command output as multiple arguments to another command
- Is there a way to change the environment variables of another process in Unix?
- Automatically enter SSH password with script
- Aborting a shell script if any command returns a non-zero value
- Use sudo with password as parameter [closed]
- Shell script: Run function from script over ssh
- How can I quickly sum all numbers in a file?
- Bash script process substitution Syntax error: “(” unexpected
- What is the difference between using `sh` and `source`?
- Setting environment variables in Linux using Bash
- How do I exclude a directory when using `find`?
- Run a shell command when a file is added
- Bash script execution with and without shebang in Linux and BSD
- How do you normalize a file path in Bash?
- How to compare two DateTime strings and return difference in hours? (bash shell)
- How do I remove newlines from a text file?
- write a shell script to ssh to a remote machine and execute commands
- How to copy a file to multiple directories using the gnu cp command
- What is the Linux equivalent to DOS pause?
- Using grep and sed to find and replace a string
- How to check if sed has changed a file
- What is the difference between “./somescript.sh” and “. ./somescript.sh”
- Counter increment in Bash loop not working
- Syntax error near unexpected token ‘then’
- Check for IP validity
- Why doesn’t “sort file1 > file1” work?