Better way to do this?
Hello all,
Need some input from how others would solve the following issue: I needed to download a file using wget, however the url was something like: Code:
https://content.web.webserve.com/web/public/NULL/package-name/anotherdir/x86_64/tomcat5-webapps-5.5.23-0jpp.14.el5.x86_64.rpm?__gda__=128942323423423423406_8d5a0asdfasdfasdf678cef05e0&ext=.rpm Code:
#!/bin/bash Thanks |
Code:
echo $URL_IN | awk 'gsub(/.*\/|?.*/,"")' |
It would run faster using bash parameter expansion (because no need for creating new processes):
Code:
c@CW8:~$ buf='https://content.web.webserve.com/web/public/NULL/package-name/anotherdir/x86_64/tomcat5-webapps-5.5.23-0jpp.14.el5.x86_64.rpm?__gda__=128942323423423423406_8d5a0asdfasdfasdf678cef05e0&ext=.rpm' |
Thank you very much colucix, catkin for the input, both approaches work perfectly!
|
All times are GMT -5. The time now is 05:16 AM. |