I'm learning some shell scripting but came across this line:
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null` Where
ls=$0 Can someone explain it to me pls?
Jump to Post
Forgetting about what the "ls" variable evaluates as, it's a pretty simple expression that just looks confusing. It's using expr's ":" string comparison operator.
on the left side you have "$ls" which you say equal $0, which is traditionally the command name if you're calling a …
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.