Quote:
Originally Posted by
Smiling Dragon
Using $() instead of the 'old fashioned backticks' won't work on bourne though
True, but AFAIK Bourne Shell is a bit outdated by now - this is what i meant by "oldfashioned". Its similar to using mono-character variable names in programs because FORTRAN/77 didn't honour more than 6 characters of an identifier. This might be, but nobody in his right mind would use a compiler which is more than 30 years old today.
Quote:
How come they shouldn't be used anymore BTW (geniune question, not stirring like my first comment was
)?
In Korn-Shell, bash and most other modern shells the "$(...)" construct offers more flexibility and better readability (backticks are easily confused with single quotes as several threads here show) and better functionality. The reason why backticks are still working in these shells is not because the authors thought these were desirable but for backward compatibility. This is not a reason to still use them, even more so as the threadstarter seems to be learning shell scripting and should adopt proper practices as early as possible.
For an in-depth discussion about backticks see Barry Rosenbergs "Hands-On ksh93 Programming" or have a look
here or take into account that backticks cannot be nested whereas "$(...)" can be, etc..
bakunin