I want to print the largest number passed in on the command line but I am not sure how to assign a variable correctly.
What is the correct way to solve this issue?
#!/bin/sh
x=0
for var in "$@";
do
if [ $var -gt $x ]; then
$x=$var #this does not work
fi
done
echo "Largest number: $x"
var=$something. Change$x=$vartox=$var.