* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Sunday, October 26, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Meet Belynda From ‘Married at First Sight’ Season 19: Age, Job, Instagram and More – Yahoo

    Meet Belynda from ‘Married at First Sight’ Season 19: Age, Career, Instagram & More Revealed!

    General Hospital’s Rena Sofer Exits as Lois — But the Door Isn’t Closed – Yahoo

    General Hospital’s Rena Sofer Exits as Lois — But the Door Isn’t Closed – Yahoo

    CNN Launches New Show – What to Know About Host Elex Michaelson – Central Oregon Daily

    Get to Know Elex Michaelson: The Dynamic New Host Taking CNN by Storm

    Johnny Depp Set To Finally Make His Big Hollywood Comeback After Amber Heard Controversy – Yahoo

    Johnny Depp Set for a Triumphant Hollywood Comeback Following Amber Heard Controversy

    ‘Chainsaw Man — The Movie: Reze Arc’ Review: Hit Manga Gets an Ultra-Violent, Surprisingly Emotional Big-Screen Adaptation – Yahoo

    Chainsaw Man – The Movie: Reze Arc Review: A Brutal and Unexpectedly Emotional Big-Screen Adaptation

    Reba McEntire Details Personal Relationship With Late Stepson Brandon Blackstock – KNDU

    Reba McEntire Shares Emotional Tribute to Her Late Stepson Brandon Blackstock

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Comments to EU Regarding the Draft Revised Technology Transfer Block Exemption Regulation and Technology Transfer Guidelines – Information Technology and Innovation Foundation

    Have Your Say: Share Your Thoughts on the Draft Revised Technology Transfer Block Exemption Regulation and Guidelines

    Ghost Tapping is exploiting tap-to-pay technology in order to steal your money; what your need to know – ABC7 New York

    Ghost Tapping: How Thieves Are Using Tap-to-Pay Technology to Steal Your Money and What You Need to Know

    New technology for grading and packing dates – FreshPlaza

    Revolutionary Technology Transforms Date Grading and Packing Process

    Project underway to upgrade technology on 911 towers in Kanawha County – WCHS

    Kanawha County Launches Major Upgrade to 911 Tower Technology

    Next steps: Technology opens new options for greater mobility – Missouri Independent

    Next Steps: How Technology is Opening Exciting New Doors to Greater Mobility

    Rydberg Technologies Inc. Announces Launch of Rydberg Photonics in Berlin – The Quantum Insider

    Rydberg Technologies Launches Exciting New Photonics Division in Berlin

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Meet Belynda From ‘Married at First Sight’ Season 19: Age, Job, Instagram and More – Yahoo

    Meet Belynda from ‘Married at First Sight’ Season 19: Age, Career, Instagram & More Revealed!

    General Hospital’s Rena Sofer Exits as Lois — But the Door Isn’t Closed – Yahoo

    General Hospital’s Rena Sofer Exits as Lois — But the Door Isn’t Closed – Yahoo

    CNN Launches New Show – What to Know About Host Elex Michaelson – Central Oregon Daily

    Get to Know Elex Michaelson: The Dynamic New Host Taking CNN by Storm

    Johnny Depp Set To Finally Make His Big Hollywood Comeback After Amber Heard Controversy – Yahoo

    Johnny Depp Set for a Triumphant Hollywood Comeback Following Amber Heard Controversy

    ‘Chainsaw Man — The Movie: Reze Arc’ Review: Hit Manga Gets an Ultra-Violent, Surprisingly Emotional Big-Screen Adaptation – Yahoo

    Chainsaw Man – The Movie: Reze Arc Review: A Brutal and Unexpectedly Emotional Big-Screen Adaptation

    Reba McEntire Details Personal Relationship With Late Stepson Brandon Blackstock – KNDU

    Reba McEntire Shares Emotional Tribute to Her Late Stepson Brandon Blackstock

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology
    Comments to EU Regarding the Draft Revised Technology Transfer Block Exemption Regulation and Technology Transfer Guidelines – Information Technology and Innovation Foundation

    Have Your Say: Share Your Thoughts on the Draft Revised Technology Transfer Block Exemption Regulation and Guidelines

    Ghost Tapping is exploiting tap-to-pay technology in order to steal your money; what your need to know – ABC7 New York

    Ghost Tapping: How Thieves Are Using Tap-to-Pay Technology to Steal Your Money and What You Need to Know

    New technology for grading and packing dates – FreshPlaza

    Revolutionary Technology Transforms Date Grading and Packing Process

    Project underway to upgrade technology on 911 towers in Kanawha County – WCHS

    Kanawha County Launches Major Upgrade to 911 Tower Technology

    Next steps: Technology opens new options for greater mobility – Missouri Independent

    Next Steps: How Technology is Opening Exciting New Doors to Greater Mobility

    Rydberg Technologies Inc. Announces Launch of Rydberg Photonics in Berlin – The Quantum Insider

    Rydberg Technologies Launches Exciting New Photonics Division in Berlin

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home Technology

amber, a code search & replace tool

May 23, 2024
in Technology
amber, a code search & replace tool
Share on FacebookShare on Twitter

Actions Status
Crates.io
codecov

amber is a code search and replace tool written by Rust.
This tool is inspired by ack,
ag, and other grep-like tools.

Recursively search from the current directory
Ignore VCS directories (.git, .hg, .svn, .bzr)
Ignore binary files
Output by the colored format

Large files (> 1MB by default) are divided and searched in parallel.

amber can replace a keyword over directories (traditionally by find … | xargs sed -i ‘…’) .
You can decide to do replacing or not interactively.

Install the amber-search-git package from AUR.

yaourt -S amber-search-git

You can install with cargo.

Download from release page, and extract to the directory in PATH.

Two commands (ambs/ambr) are provided. ambs means “amber search”, and ambr means “amber replace”.
The search keyword is not regular expression by default. If you want to use regular expression, add –regex.

ambs keyword // recursively search ‘keyword’ from the current directory.
ambs keyword path // recursively search ‘keyword’ from ‘path’.
ambr keyword replacement // recursively search ‘keyword’ from the current directory, and replace to ‘replacement’ interactively.
ambr keyword replacement path // recursively search ‘keyword’ from ‘path’, and replace to ‘replacement’ interactively.

amber replace interactively by default. If the keyword is found, the following prompt is shown, and wait.
If you input ‘y’, ‘Y’, ‘Yes’, the keyword is replaced. ‘a’, ‘A’, ‘All’ means replacing all keywords non-interactively.

Replace keyword? ( Yes[Y], No[N], All[A], Quit[Q] ):

If –regex option is enabled, regex captures can be used in replacement of ambr.

$ cat text.txt
aaa bbb
$ ambr –no-interactive –regex ‘(aaa) (?bbb)’ ‘$1 $pat ${1} ${pat}’ test.txt
$ cat text.txt
aaa bbb aaa bbb

You can change configuration by writing a configuration file.
The locations of the configuration file is OS-specific:

Linux: ~/.config/amber/ambs.toml, /etc/amber/ambs.toml
macOS: ~/Library/Preferences/com.github.dalance.amber/ambs.toml, /etc/amber/ambs.toml
Windows: ~/AppData/Roaming/dalance/amber/config/ambs.toml

For compatibility, if ~/.ambs.toml exists, it will be preferred to
the OS-specific locations.

The above paths are examples for the configuration of ambs command.
ambr.toml in the same directory is used for ambr command.

Available entries and default values are below:

regex =false
column =false
row =false
binary =false
statistics =false
skipped =false
interactive =true
recursive =true
symlink =true
color =true
file =true
skip_vcs =true
skip_gitignore=true
fixed_order =true
parent_ignore =true
line_by_match =false

You can choose some entries to override like below:

CPU: Intel(R) Xeon(R) Gold 6134 CPU @ 3.20GHz
MEM: 1.5TB
OS : CentOS 7.5

source1: https://github.com/torvalds/linux ( 52998files, 2.2GB )
source2: https://dumps.wikimedia.org/jawiki/latest/jawiki-latest-pages-articles.xml.bz2 ( 1file, 8.5GB )

pattern1( many files with many matches ) : ‘EXPORT_SYMBOL_GPL’ in source1
pattern2( many files with few matches ) : ‘irq_bypass_register_producer’ in source1
pattern3( a large file with many matches ) : ‘検索結果’ in source2
pattern4( a large file with few matches ) : ‘”Quick Search”‘ in source2

amber (v0.5.1)
ripgrep (v0.10.0)
grep (v2.20)
fastmod (v0.2.0)
find/sed (v4.5.11/v4.2.2)

hyperfine with the following options.

–warmup 3: to load all data on memory.

search ( compare_ambs.sh )

pattern
amber
ripgrep
grep

1
212.8ms ( 139% )
154.1ms ( 100% )
685.2ms ( 448% )

2
199.7ms ( 132% )
151.6ms ( 100% )
678.7ms ( 448% )

3
1.068s ( 100% )
4.642s ( 434% )
3.869s ( 362% )

4
1.027s ( 100% )
4.409s ( 429% )
3.118s ( 304% )

replace ( compare_ambr.sh )

pattern
amber
fastmod
find/sed

1
792.2ms ( 100% )
1231ms ( 155% )
155724ms ( 19657% )

2
418.1ms ( 119% )
352.4ms ( 100% )
157396ms ( 44663% )

3
18.390s ( 100% )
74.282s ( 404% )
639.740s ( 3479% )

4
17.777s ( 100% )
74.204s ( 417% )
625.756s ( 3520% )

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://github.com/dalance/amber

Tags: AmberSearchtechnology
Previous Post

Mapping variant effects on anti-tumor hallmarks of primary human T cells with base-editing screens

Next Post

Make your own backdoor: CFLAGS code injection, Makefile injection, pkg-config

World Series 2025: Dodgers’ worst-case scenario plays out as Blake Snell, bullpen crumble in Game 1 vs. Blue Jays: ‘Not a good feeling’ – Yahoo Sports

World Series 2025: Dodgers’ Nightmare Unfolds as Blake Snell and Bullpen Collapse in Game 1 vs. Blue Jays

October 26, 2025
“Bending, not breaking”: The global economy’s new normal – J.P. Morgan

Bending, Not Breaking: Embracing the New Normal of the Global Economy

October 26, 2025
Meet Belynda From ‘Married at First Sight’ Season 19: Age, Job, Instagram and More – Yahoo

Meet Belynda from ‘Married at First Sight’ Season 19: Age, Career, Instagram & More Revealed!

October 26, 2025
80,000 Coloradans projected to drop health insurance amid premium spike – KUSA.com

80,000 Coloradans Expected to Lose Health Insurance as Premiums Soar

October 26, 2025
Trump departs for Asia where he will meet with China’s Xi. Here’s what else to expect – PBS

Trump departs for Asia where he will meet with China’s Xi. Here’s what else to expect – PBS

October 26, 2025
New Research Shows Changing Winters Will Hit Northern Lakes the Hardest – Hometown Focus

New Research Reveals How Changing Winters Threaten Northern Lakes the Most

October 25, 2025
Scientists reversed brain aging and memory loss in mice – Science Daily

Breakthrough Discovery: Scientists Reverse Brain Aging and Restore Memory in Mice

October 25, 2025
It’s alive! Spooky science activities to take place Oct. 25-26 at Discovery Playhouse – KFVS12

It’s Alive! Exciting Spooky Science Activities Coming to Discovery Playhouse Oct. 25-26

October 25, 2025
Buying property in Israel: how to choose between lifestyle and investment goals – Ynetnews

Buying Property in Israel: Balancing Your Lifestyle Dreams with Smart Investment Choices

October 25, 2025
Comments to EU Regarding the Draft Revised Technology Transfer Block Exemption Regulation and Technology Transfer Guidelines – Information Technology and Innovation Foundation

Have Your Say: Share Your Thoughts on the Draft Revised Technology Transfer Block Exemption Regulation and Guidelines

October 25, 2025

Categories

Archives

October 2025
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Sep    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (886)
  • Economy (908)
  • Entertainment (21,779)
  • General (17,806)
  • Health (9,949)
  • Lifestyle (920)
  • News (22,149)
  • People (908)
  • Politics (918)
  • Science (16,118)
  • Sports (21,407)
  • Technology (15,887)
  • World (891)

Recent News

World Series 2025: Dodgers’ worst-case scenario plays out as Blake Snell, bullpen crumble in Game 1 vs. Blue Jays: ‘Not a good feeling’ – Yahoo Sports

World Series 2025: Dodgers’ Nightmare Unfolds as Blake Snell and Bullpen Collapse in Game 1 vs. Blue Jays

October 26, 2025
“Bending, not breaking”: The global economy’s new normal – J.P. Morgan

Bending, Not Breaking: Embracing the New Normal of the Global Economy

October 26, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version