# Macros / variables in /usr/share/skel



## Seeker (Nov 18, 2009)

So, _/usr/share/skel_, reporesents new user's home layout.
Now I add file _/usr/share/skel/welcome_

Is it possible to have macros / variables in /usr/share/skel/welcome file?

So for new user john, file welcome(txt file, NOT a script!), would be:

```
Welcome to the club john!
Your home dir is /usr/home/john
```
Derived from /usr/share/skel/welcome:

```
Welcome to the club $USER!
Your home dir is $HOME
```


----------



## SirDice (Nov 18, 2009)

Yes, but this file will be copied "as is" to the new user's home directory. Why not add it to .profile or something similar?


----------



## Seeker (Nov 18, 2009)

I don't understand.
Example?


----------



## SirDice (Nov 18, 2009)

.profile is started when a (ba)sh shell starts. It's executed each time a user logs in. Similarly .cshrc is executed each time a user logs in with (t)csh.

Add commands to that to echo those lines. Something like


```
echo "Welcome $USER"
echo "Your home directory is $HOME"
```


----------



## Seeker (Nov 18, 2009)

Oh, I see.
That I knew, but was not a point.

Maybe example was too simple, as I just narrowed it.

Some text file, with some extension(if any), is dynamically created in user's home dir, *when* that user *is created*. (This means, only once in time, for that users)

Maybe it will be sh script, created based on it's template in skel, but customized for *new user*, eg $HOME path is diff, for each user.

Clearer now?


----------



## SirDice (Nov 18, 2009)

Yes, I understood what you meant. But for it to work you'd probably have to write your own adduser type tool.


----------



## Seeker (Nov 19, 2009)

Yes, there are absolutely many other methods.

But I am always, trying to do things at the lowest level possible.

So, here we can conclude that skel can't do this.
skel layout will always be blind carbon copy, "as is".


----------



## SirDice (Nov 19, 2009)

Seeker said:
			
		

> skel layout will always be blind carbon copy, "as is".


Exactly


----------

