Solved Removal of '#' from sample code

Many posts provide examples of sample code for which I am very grateful, but one thing I often find myself doing is removing '#' from the start of the line when copying lines into some shell script.

How do others deal with removing this character?

Here is an example of what I mean:-


Actually, I just noticed a number of these example have a small icon in the top right hand corner which copies the code to your clipboard.
Is this new as I never noticed it before.
 
but one thing I often find myself doing is removing '#' from the start of the line when copying lines into some shell script.
They are command prompts, the # indicates it's a root prompt. Like # pkg install drm-kmod
 
They are command prompts, the # indicates it's a root prompt. Like # pkg install drm-kmod
Yes, I know they are prompts, but when you are copying and pasting them they are a pain.

I just noticed a little icon that copies the code to your clipboard. Is that a recent addition?
 
Yes, I know they are prompts, but when you are copying and pasting them they are a pain.
You're supposed to copy/paste these to a prompt, the # of root's prompt kind of adds a layer of protection, as it's interpreted by the shell as a remark. It prevents accidentally copy/pasting something utterly destructive as root.

I just noticed a little icon that copies the code to your clipboard. Is that a recent addition?
Think it's always been there. But I don't read the handbook that often. It certainly was present on whole blocks of code/configuration files. Maybe they did add one for the single line command prompts too.
 
It's backslash with me always. I mostly notice what happens. If things stop working suddenly, that's a typo in 1 of the last files.
You could use the locate-db to scan all files with shell code and check the first line,
 
Back
Top