Trying to replace a toilet's water supply line
As was mentioned, the gray hose is connected with a compression fitting at the bottom, and maybe a pre-crimped fitting at the top. In any case, they thread right off. 

I'd go buy a stainless mesh-wrapped hose in the next length up from what you need and with the correct end fittings (standard for a toilet). These will have integrated seals, so just snug them up slightly.

Put a slight corkscrew twist in it to take up the slack. It'll look great. 

Optionally replace the valve with a nice clean new one and shorten the supply pipe to get it closer to the wall. This will require a compression fitting, but they're not difficult if you start with a clean pipe. Be sure to use two wrenches, one on the valve body and one on the connection nut, so as not to strain the pipe.