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?
rhesus303
0
Newbie Poster
Recommended Answers
Jump to PostHey There,
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
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.