Question

The code in my Zsh

#!/bin/zsh
q=$1

open "http://mathworld.wolfram.com/$q.html"

I put the input to the app

triangle

I get an error at Wolfram, since the first letter must be a big one.

How can you change the case for the first letter in the variable q?

Was it helpful?

Solution

# q=triangle
# echo ${(C)q}
Triangle

See Parameter Expansion Flags.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top