nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

.jar file follow the naming convention, cannot open without using ' ' #367

Closed CarrieLi1015 closed 1 year ago

CarrieLi1015 commented 1 year ago

We just found out that for mac, if following in the school naming convention, like [CS2103][name].jar. The file cannot be opened.

For example, java -jar [CS2103][name].jar could not open the .jar file. One way to open it is using java -jar '[CS2103][name].jar', another is to use java -jar *.jar

Since we are not sure if it is cause by zsh set up or it is a general issue for all mac users. May we ask if we will be penalised by this? As we did not specific it inside UG and for those who does not know this might not be able to open our .jar file.

Or is it possible to make an announcement that for mac user, need to wrap the .jar file name with ' ' or use *.jar in order to open it?

damithc commented 1 year ago

@CarrieLi1015 hmm... we used the same naming convention in previous PEs but this issue did not come up.

Other Mac users, are you facing similar problems?

angjunkang commented 1 year ago

I have similar issues on my mac as well. My guess is this might be due to the square brackets in the jar file.

CarrieLi1015 commented 1 year ago

Hi prof, we just checked our file with a few other mac users. Some of them can open without using ' ', some of them cannot. We are not sure whether it is due to different mac model (so different shell version, I think zsh will have problem but bash will not Terminal version).

Screenshot 2023-04-11 at 3 10 43 PM

name wrap inside ' ' can work.

Screenshot 2023-04-11 at 3 12 14 PM

After remove the square bracket can work, might because square bracket is Regex expression in Unix?

damithc commented 1 year ago

@CarrieLi1015 I've updated PE instructions to encourage everyone to use double quotes around the jar file name, as follows:

image

To confirm, the above works in your shell, right?

CarrieLi1015 commented 1 year ago

@CarrieLi1015 I've updated PE instructions to encourage everyone to use double quotes around the jar file name, as follows:

image

To confirm, the above works in your shell, right?

Yes it works on my shell. Thank you prof!