gpt-3.5-turbo-0125· OpenAI
WildChat-4.8M (AI2)
Develop a script in bash that takes the temperature value in Celsius OR Kelvins and…
- User
Develop a script in bash that takes the temperature value in Celsius OR Kelvins and returns the inverse value. The formula is pretty simple: C = K - 273; K = C + 273. It should return a single line with no spaces, like: ./temp.sh 122K -> -151C
- Assistant
#!/bin/bash
input={input::-1} unit=${input: -1}
if [ (echo "kelvin"K elif [ (echo "celsius"C else echo "Invalid input. Please enter a temperature value in Celsius or Kelvins." fi
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.