Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm in an online Intro to Unix class. We are using Fedora 20 with VirtualBox. Obviously, as this is for a class, I would normally ask the teacher. But it is an online class, and my professor generally waits a week or so before answering emails.
My question is this: What is the difference between variable expansion and pathname expansion?
I'm supposed to write a script that demonstrates that variable expansion occurs before pathname expansion. I've looked at the BASH Manual for every reference of variable expansion and pathname expansion, and two paragraphs that are in the textbook.
I think that variables on the command line are expanded first normally?
My question is this: What is the difference between variable expansion and pathname expansion?
I'm supposed to write a script that demonstrates that variable expansion occurs before pathname expansion. I've looked at the BASH Manual for every reference of variable expansion and pathname expansion, and two paragraphs that are in the textbook.
I think that variables on the command line are expanded first normally?
Have a look at the bash manpage, specifically the section EXPANSION:
Code:
Expansion is performed on the command line after it has been split into words. There are
seven kinds of expansion performed: brace expansion, tilde expansion, parameter and vari‐
able expansion, command substitution, arithmetic expansion, word splitting, and pathname
expansion.
The order of expansions is: brace expansion, tilde expansion, parameter, variable and
arithmetic expansion and command substitution (done in a left-to-right fashion), word
splitting, and pathname expansion.
On systems that can support it, there is an additional expansion available: process sub‐
stitution.
There is also a subsection for each type of expansion, definitely more than two paragraphs...
Here's a couple of sites that you might find useful:
@azazalolxd this is not a constructive post to this thread. You have been a member since 2013. I suggest that you re-read LQ Rules so that you can post in the correct manner.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.