script execute command problem
i would like to create a script that calls a command with a flag....
/usr/bin/wget calling "curl -O" -------------------------------answering my own post----------------------------------- sudo su cat > /usr/bin/wget << EOF #!/bin/bash curl -O $1 EOF chmod 750 /usr/bin/wget exit the real question is this script properly written, and if not how would a more proper writing of this script look |
I would have said the real question is why would you try to recreate wget when it already exists and may already be on your system so this may actually cause a conflict.
As to whether or not it will work ... the old adage of suck it and see looks good for such a short non-impacting script. |
curl supports moar protocol than wget......
|
The use of "<<EOF" is pointless.
Unless one want to type more than needed. The single "cat > DoNotNameAnyScriptLikeAnExistingCommand" does the trick. (If finished give it the EOF with ^d meaning <ctrl><d> ) Code:
#!/bin/bash |
All times are GMT -5. The time now is 07:35 PM. |