Here's a weird one for you: (cat | sh)

I am very confused and curious.

I am following the Linode guide to install FreeBSD and I got as far as booting into Finnix, dd'ing the latest memdisk.img to /dev/sda.

For some reason, pasting

curl | dd of=/dev/sda

into Weblish did not work (curl 0 bytes read forever).
I tried Glish, but there is no paste there (that I could find), so I tried typing manually, only it seems Glish is set to a us keymap and I couldn't find a way to input the pipe character from my keyboard. Anyway, this is not my query.

The next thing I tried was to go back to Weblish:

root@ttyS0:~# echo "curl | dd of=/dev/sda" >
root@ttyS0:~# chmod +x
root@ttyS0:~# ./

This did not work either.

For whatever reason I thought I'd try

root@ttyS0:~# cat | sh

and that worked.


1 Reply

From your description of the issue, it sounds like you just need to add the Shebang to your .sh script in order for that to work from the command line. You can find a ton of informmation on the shebang, and why it's necessary on the following Wikipedia article:

In addition, you may want to look over the FreeBSD download page to check for the latest version.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct