Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

3 votes
2 answers
1218 views
How to use a toml lens on a single file on Ubuntu 20.04?
I need to read and modify a single file (`pcmanfm.conf`) in the current directory. I tried ``` $ augtool -At "Toml.lns incl $(pwd)/pcmanfm.conf" -I lenses/ print /files /files ``` but it does not work. `toml.aug` (on `/usr/share/augeas/lenses/dist/toml.aug`) starts with ``` (* Module: Toml Parses TO...
I need to read and modify a single file (pcmanfm.conf) in the current directory. I tried
$ augtool -At "Toml.lns incl $(pwd)/pcmanfm.conf" -I lenses/ print /files
/files
but it does not work. toml.aug (on /usr/share/augeas/lenses/dist/toml.aug) starts with
(*
Module: Toml
  Parses TOML files

Author: Raphael Pinson 
...
so I believe I put the name of the lens correctly (Toml.lns). The same setup works well if I parse file of a different type, e.g.
$ augtool -At "Shellvars.lns incl /tmp/vars.sh" -I lenses/ print /files
/files
/files/tmp
/files/tmp/vars.sh
/files/tmp/vars.sh/TESTINT = "2"
/files/tmp/vars.sh/TESTSTR = "\"FF\""
I've posted the same question on https://github.com/hercules-team/augeas/issues/699 in case it is a bug in Augeas. The file I try to parse has the following content:
[config]
bm_open_method=0

[volume]
mount_on_startup=1
mount_removable=1
autorun=1

[ui]
always_show_tabs=0
max_tab_chars=32
win_width=1916
win_height=1149
splitter_pos=150
media_in_new_tab=0
desktop_folder_new_win=0
change_tab_on_drop=1
close_on_unmount=1
focus_previous=0
side_pane_mode=places
view_mode=compact
show_hidden=0
sort=name;ascending;
toolbar=newtab;navigation;home;
show_statusbar=1
pathbar_mode_buttons=0
I want to add/replace one value in the [ui] section.
Adam Ryczkowski (5879 rep)
Oct 17, 2020, 09:52 AM • Last activity: Aug 25, 2021, 06:23 PM
0 votes
1 answers
78 views
What is the scope of lens in saltStack?
I am working on Salt related stuffs, here I found **lens** inside the augeas module.I have been looked into the saltStack documentation but I could not able to figure out what it actually does ? augeas.change: - context: /files/etc/redis/redis.conf - lens: redis.lns - changes: - set bind 0.0.0.0 - s...
I am working on Salt related stuffs, here I found **lens** inside the augeas module.I have been looked into the saltStack documentation but I could not able to figure out what it actually does ? augeas.change: - context: /files/etc/redis/redis.conf - lens: redis.lns - changes: - set bind 0.0.0.0 - set maxmemory 1G Here in above rule my understanding is look for the file redis.conf and set the bind parameter to 0.0.0.0. But my question is what **lens: redis.lns** will do here ? Your help will be appreciated.
Abdulvakaf K (181 rep)
Mar 13, 2018, 07:08 AM • Last activity: Mar 13, 2018, 12:39 PM
0 votes
2 answers
1059 views
add alias for localhost in /etc/hosts using Augeas
I am trying to use `augtool` to auto edit my `/etc/hosts`, as I wish to add an alias for localhost (so that I can test my webserver with a different host-name, localy). I have been looking every-ware to find good documentation. I with to find the node with `ipaddr` of `127.0.0.1` and add an alias to...
I am trying to use augtool to auto edit my /etc/hosts, as I wish to add an alias for localhost (so that I can test my webserver with a different host-name, localy). I have been looking every-ware to find good documentation. I with to find the node with ipaddr of 127.0.0.1 and add an alias to it. I would also like to find some good documentation to Augeas.
ctrl-alt-delor (28626 rep)
Sep 17, 2017, 05:28 PM • Last activity: Sep 19, 2017, 04:10 PM
0 votes
2 answers
1217 views
With Augeas, how can i modify the value of an attribute, using the current value?
Let's say I have some generic INI-type file, covered best by the Samba.lns. I have an entry like: attribute = value And I want to _transform_ `value` to `Some-VALUE-x`. For a more concrete example: augtool> print /files/etc/yum.conf/main/cachedir /files/etc/yum.conf/main/cachedir = "/var/cache/yum/$...
Let's say I have some generic INI-type file, covered best by the Samba.lns. I have an entry like: attribute = value And I want to _transform_ value to Some-VALUE-x. For a more concrete example: augtool> print /files/etc/yum.conf/main/cachedir /files/etc/yum.conf/main/cachedir = "/var/cache/yum/$basearch/$releasever" And I want to change the value to: "/var/cache/yum/noarch/$releasever" That is, I want to replace $basearch with noarch and leave the rest alone. My actual example is a little more complex. Can I even do this within augeas?
Otheus (6357 rep)
Sep 27, 2016, 10:57 PM • Last activity: Oct 4, 2016, 06:11 PM
Showing page 1 of 4 total questions