ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. Tags
    3. sed
    Log in to post
    • All categories
    • D

      Solved Scripted visudo updates

      IT Discussion
      • sed visudo apple unix terminal shell zsh • • DustinB3403
      16
      0
      Votes
      16
      Posts
      1.4k
      Views

      D

      @stacksofplates said in Scripted visudo updates:

      @DustinB3403 said in Scripted visudo updates:

      Well I managed to get the file created, I had to use visudo to create a custom file with my edits.

      I'm testing it now to see if everything works.

      Really? It doesn't let you just sudo a file in the dump directory? I wonder how they are enforcing that?

      Yeah, not sure why it was having a hissy fit over it, but I've got a good working custom sudoer.d/god file now that can be used for what I have, and I can simply cp that into the appropriate folder and reset the perms on it (if required) to get everything working.

      Thanks for the help guys!

    • W

      Fedora - Automating Config File Modifications

      IT Discussion
      • fedora configuration management cm tool automate config file sed • • wrx7m
      5
      1
      Votes
      5
      Posts
      826
      Views

      I

      @wrx7m said in Fedora - Automating Config File Modifications:

      Without using a CM tool, what is the easiest way to automate modifications to several config files across 7-8 servers? I was looking at sed, but am not sure if there is a better tool that isn't a CM.

      More specifically, I have several Fedora servers running squid proxy. From time to time, I need to modify the config file to whitelist a particular domain. Because I will soon have a few more servers, I would like to automate these type of file updates so I don't have to manually go into each server's config and copy and paste stuff in to certain sections; some information is specific to a particular server, where as this section would be universally necessary on all servers. So, I would be inserting lines in specific sections.

      I intend to move to some sort of CM for this stuff in the future, but I need to get these going sooner than I could learn the CM tool.

      Sync with a s3 bucket hourly. Then you only need to update on s3

    • D

      Using SED to replace a line with spaces

      IT Discussion
      • cli sed editing • • DustinB3403
      7
      0
      Votes
      7
      Posts
      879
      Views

      J

      @DustinB3403 said in Using SED to replace a line with spaces:

      @JaredBusch said in Using SED to replace a line with spaces:

      I typically use / instead of ~ for the delimiter, looks right.

      Have to use ~ because I'm adding a URL in the part that's being replaced.

      Also that did work, not sure why it wasn't showing the change first time.

      Thanks for the sanity check.

      wait...... I skimmed. I admit..

      You have to escape spaces or wrap it in quotes.

      Oh it worked.. then all good. Ignore me..

      I'm busy unpurging email.

    • J

      Make this command better

      IT Discussion
      • scripting bash sed rsync directory comparison • • JaredBusch
      5
      1
      Votes
      5
      Posts
      704
      Views

      M

      @JaredBusch : I'm not certain if this fits the bill, but what about the "diff" command? Of course, this does nothing to sync the files but does offer a way to simply compare the directories.

      diff -rs manxam jaredbusch

      This will get you :

      Files /home/manxam/TEST and /home/jaredbusch/TEST are identical Only in /home/manxam: i_am_manxam Only in /home/jaredbusch: you_are_jared
    • S

      Remove Double Quotes from File with Sed

      IT Discussion
      • sed • • scottalanmiller
      1
      3
      Votes
      1
      Posts
      396
      Views

      No one has replied

    • J

      How can I sed or regex this out

      IT Discussion
      • regex sed • • JaredBusch
      7
      2
      Votes
      7
      Posts
      1.2k
      Views

      R

      @jaredbusch said in How can I sed or regex this out:

      @romo said in How can I sed or regex this out:

      @jaredbusch said in How can I sed or regex this out:

      ****** Object: UserDefinedFunction [dbo].[FiscalMo] Script Date: 11/30/2017 10:24:23 AM ******

      sed 's/Script.*M //g'

      I need at least one * and the / to close.

      So this?

      sed 's/Script.*M /\ \*\//g'

      You are escaping seds delimiters with that.

      Changing the delimiters for better clarity:

      sed 's|Script.*M ||g'

      From Script to M + space, replace with space,. It keeps all your * and the final /.

      0_1512131437191_Screenshot_20171201-062914.png

    • 1 / 1