Skip to content
← Back to Community
bash
Profile icon
Bunnytoes

I want to make a bash script so if you run it, it will join a room, but also if I go to shell I can still pick a room. the code I use to run it is javac GroupChat.java then java GroupChat 239.00.0 1234 239.00.0 is multicast host and 1234 is the port

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
Bunnytoes
Comments
hotnewtop
Profile icon
Coder100

use read

# compile it here # ... javac GroupChat.java read -p "room ip? " room java GroupChat $room

note replit only hosts 0.0.0.0

Profile icon
Bunnytoes

@Coder100 but when I do it, I can do 239.00.0

Profile icon
Bunnytoes

@Coder100 put that in the bash file and use .replit to run the bash code?

Profile icon
Bunnytoes

@Coder100 thank you

Profile icon
Coder100
  1. yes
  2. np @Bunnytoes
Profile icon
Bunnytoes

@Coder100 can you help me, I tested this with a friend, but as of now it won't enter to socket and I can't print the name, I used System.getenv("REPL_OWNER"); for the name

Profile icon
Coder100

@Bunnytoes what ip?

Profile icon
Bunnytoes

@Coder100 239.00.0 and port 1234 it might be fixed, but I can't test it