LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Typing out this command works over "pasting" it, could this be an anomaly in xfce4-terminal? (https://www.linuxquestions.org/questions/linux-newbie-8/typing-out-this-command-works-over-pasting-it-could-this-be-an-anomaly-in-xfce4-terminal-4175597544/)

d_K 01-16-2017 12:18 AM

Typing out this command works over "pasting" it, could this be an anomaly in xfce4-terminal?
 
I'm seriously at a loss on this one. I wanted to zero out my usb drive the other day so I copied & pasted the command but my terminal emulator spat back an error saying the target device is not found (...or something to that effect, I don't remember the exact error.) The command in question:

Code:

sudo shred -vzn 0 /dev/sdd
...there's no fancy quotation marks, "sdd" is the actual usb drive listed in "disks", and yes -- that '0' is really a '0' not 'O'. The copy function did not include the carriage return character. I don't seem to recall this happening on MATE so my first guess is an anomaly in xfce4-terminal -- the default emulator in xfce. I then copied and pasted both commands into xed (i forgot which text editor fork this is based off of) to confirm both are textually-identical using ctrl+f and then comparing the strings.

Does anyone have a clue on this?

Turbocapitalist 01-16-2017 03:38 AM

In general it is important to first copy to a pain-text editor like xed or Gedit and the re-copy to the buffer to avoid any CSS or Javascript traps. It's good that you did that.

It'd be hard to say without seeing the exact web page that was the source. There are harmless but annoying invisible Unicode characters that can get in the way but a malicious site could do a lot of damage to your system with shred

d_K 01-16-2017 03:50 AM

Quote:

Originally Posted by Turbocapitalist (Post 5655593)
In general it is important to first copy to a pain-text editor like xed or Gedit and the re-copy to the buffer to avoid any CSS or Javascript traps.

That's exactly what I did. I have a simple text file with useful commands and this is one of them. I can't figure out what the problem is so this needs to be on the x-files or something.

There's one possibility...I noticed the "line ending" selection is set on "windows" when "saving as" the file in xed. I know the windows carriage return is different than the "Unix" one so that might explain it. Could the xfce terminal emulator choke on a windows carriage return? It's not like I'm selecting multiple lines...I'm only selecting 1 line to copy in xed.

Turbocapitalist 01-16-2017 03:56 AM

Yes, MS-DOS uses \r\n and the Unixes use \n, so that uneccessary \r might be in the way. What happens when you convert the file to Unix new lines and then try copy-paste?

If that trailing \r is somehow getting picked up by your buffer and pasted into the terminal, then it would be at the end, which you have as the device name. In such a case it would be normal to get a device not found error.

AnanthaP 01-16-2017 05:32 AM

whats dev/sdd mounted as?


All times are GMT -5. The time now is 09:46 PM.