red hat script with curl
hi guys , i am trying to create script with curl command:
curl -v "http://x.x.x.x......" sleep 5 about 300 of this commands, it will help me to remotely log off and login cisco phones. How can I run that text file/script? Is it just : file [file location] ? should i make it exe ? please share steps thank you |
Code:
#! /bin/bash You need to make it executable with: Code:
chmod +x myscript You can discover the path with: Code:
echo $PATH |
Yes you should put your commands into a file and make that file executable. You can run that file, providing you are in the directory where it is located, or if it resides in a directory which is in your $PATH variable.
There is also some syntax relevant to bash scripts which you need to be aware of. Recommend you use The Bash Beginners Guide as a general guide to learning bash scripting. A first script example is shown in Section 1.5.5: An example Bash script: mysystem.sh and this should show you a great example in line with what you're doing here and help you with the syntax I'm referring to. |
Thank you guys. Is there a way to get logs, output results ?
|
Quote:
Back to the reference Appendix A: Shell Features where you'll find the input/output redirectors. There are examples throughout that document if you search for redirect. It is a matter of choosing between ">" for redirect to file (new), or ">>" redirect to file (append) |
Quote:
|
All times are GMT -5. The time now is 12:43 PM. |