gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
can you write a script in bash that will write pihole -g in terminal and press enter
- User
can you write a script in bash that will write pihole -g in terminal and press enter
- Assistant
Sure, here's a simple Bash script that will write the command "pihole -g" in the terminal and press enter:
#!/bin/bash # Send 'pihole -g' to the terminal and press Enter echo "pihole -g" | xdotool type --clearmodifiers --delay 0 --file - xdotool key --clearmodifiers ReturnSave the script with a
.shextension (e.g.,pihole_script.sh), make it executable (chmod +x pihole_script.sh), and then you can run it in the terminal with./pihole_script.sh. It will automatically trigger the "pihole -g" command. Note that you need to havexdotoolinstalled for this script to work, which can be installed using package managers likeaptoryum.