To elaborate on that, the dollar sign is a convention to represent the command prompt that you see in the Terminal to the left of the flashing cursor, before you've typed anything. So you're only supposed to type whatever is printed after that. Depending on your exact configuration, the prompt you actually see in the terminal may be a "$", or a ">", some other text (e.g. your username, or your Mac's hostname, or the current directory) followed by a "$", or something completely different.
– calum_bJul 3 '17 at 14:18

Swift is automatically installed if you have/install Xcode. If that is your case, check first the command "which swift" in Terminal. Suggest to use Xcode and playgrounds first, easier until get experienced with Terminal
– YoanJul 3 '17 at 14:54

I would step back from bash and terminal if the primary goal is learning swift. You don't need to get to the repl in terminal and I would argue - if you have an iPad, you should start there instead of Xcode.

If you want to (or have to) start on the Mac - open Xcode from the App Store and then make a new playground - save it to your desktop and you should have a window that looks like this to start coding without needing bash or the more detailed setup page you linked to.

The help for playgrounds should get you going - it's much easier to open the help in the app, but it's also available on the web.

There's a time to learn bash and terminal and maybe that's your end goal, but reading your post I'd rather point you to the applications designed to remove all the plumbing, patching, command line configuration and get you playing with the actual code and learning swift.

thank you everyone for your answers but i have another question: should i also omit the $ in the "${PATH}" part also?
– mutucanJul 4 '17 at 7:37

@mutucan one question per question is best. Why not form your next one and post. A link here help if nay backstory here illustrates the new post. Just be sure the new question can stand alone with pertinent details.
– bmike♦Jul 4 '17 at 10:01