On 09/12/2016 04:37 PM, bruce wrote:
awk -F': ' '{print $2}' | tail -1 | sed 's/.*storeId=\(.*\).&/\1/'
You've got good answers, especially Cameron's. It had one error,
though. If the URL is in a variable, it needs to be an argument to printf:
url='http://venturacollege.bncollege.com/webapp/wcs/stores/servlet/BNCBHomePage?storeId=78236&campusId=78236&userId=-1002&catalogId=10001&ddkey=http:BNCBMultiCampusPageCmd'
store_id=$( printf '%s\n' | tr '?&' '\012\012' | sed -n 's/^storeId=//p' )
The reason I like Cameron's advice in particular is that it doesn't use
".*". In this case, performance isn't measurably bad, but using ".*"
can eat a lot of CPU cycles.
https://blog.mariusschulz.com/2014/06/03/why-using-in-regular-expressions-is-almost-never-what-you-actually-want
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org