You are not logged in.

#1 2015-11-01 16:27:20

zencefil
Member
Registered: 2015-10-20
Posts: 27

[SOLVED] How to "source" a file correctly?

Hi,

I'm experiencing the problem explained in this post:
https://bbs.archlinux.org/viewtopic.php?id=202782

A suggested solution is to "source the /etc/X11/xinit/xinitrc.d/50-systemd-user.sh file at .xinitrc "
So how does "sourcing" work? Is there a universal way/command? Does it mean just to execute the desired script or to link it to one of the present variables ("userresources", "sysresources" or other I find in /etc/X11/xinit/xinitrc) ?

In a comment on the bug report, one user suggested a script for sourcing. But as it's a common concept/practical skill required for using Arch, I would be thankful for a general explanation.

Last edited by zencefil (2015-11-01 21:10:42)

Offline

#2 2015-11-01 16:31:36

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: [SOLVED] How to "source" a file correctly?

Follow the advice in the ArchWiki page about .xinitrc

cp /etc/X11/xinit/xinitrc ~/.xinitrc

This will create a template which will start the necessary scripts -- modify to your needs.
https://wiki.archlinux.org/index.php/Xi … figuration

To source a file, use:

source $FILE

Last edited by Head_on_a_Stick (2015-11-01 16:31:49)


Jin, Jîyan, Azadî

Offline

#3 2015-11-01 16:33:29

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] How to "source" a file correctly?

'source' is a builtin command in bash shell.
look at bash man page for details.

Offline

#4 2015-11-01 17:06:56

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [SOLVED] How to "source" a file correctly?

To be more POSIX compliant, one should use '.' to source a file:

. /etc/X11/xinit/xinitrc.d/50-systemd-user.sh

Just my two anti-bashims-cents smile


pkgshackscfgblag

Offline

#5 2015-11-01 21:10:17

zencefil
Member
Registered: 2015-10-20
Posts: 27

Re: [SOLVED] How to "source" a file correctly?

great, thank you for the explanations!

Offline

Board footer

Powered by FluxBB