a8486e79-4b2d-4dc3-a129-9ff7dc21de28
prompter
Write me POSIX-shellscript to convert Celsius to Kelvin.
7fcc19b7-3420-459f-97bb-4678d54ff5bf
a8486e79-4b2d-4dc3-a129-9ff7dc21de28
assistant
The following POSIX shell script can be used to convert Celsius to Kelvin. It uses the `bc` program to perform the actual computation.

```sh
#!/bin/sh

# Check if an argument has been passed to the script
if [ $# -eq 0 ]; then
  echo "Usage: $0 <celsius_temperature>"
  exit 1
fi

# Read the celsius value from the first argument given to the script
temp_c=$1

# Convert Celsius to Kelvin utilizing the "basic calculator"
temp_k=$(echo "$temp_c + 273.15" | bc)

# Print the result to stdout
echo "$temp_c °C = $temp_k K"
```

If the script is saved as a file named `convert.sh`, 23°C could be converted to Kelvin by typing `sh convert.sh 23`