Created
December 5, 2024 14:20
-
-
Save e-minguez/492b6d70cac5f0a3c800b6b856987099 to your computer and use it in GitHub Desktop.
Get the list of occurences on a word in bash running on a container.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podman run -it --rm registry.opensuse.org/opensuse/leap:latest /bin/bash -c $' | |
word="example" | |
script_content=$(cat "/proc/$$/cmdline" | xargs -0) | |
count=$(echo "$script_content" | grep -ow "$word" -c) | |
echo "${count}" | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment