President Trump signed a bill to fund the government through the end of January, ending the shutdown that has dragged on for six weeks.