skip to Main Content

Centos – sed can’t handle emojis

#!/bin/sh emoji="U1f300-U1f5ffU1f900-U1f9ffU1f600-U1f64fU1f680-U1f6ffU2600-U26ffU2700-U27bfU1f1e6-U1f1ffU1f191-U1f251U1f004U1f0cfU1f170-U1f171U1f17e-U1f17fU1f18eU3030U2b50U2b55U2934-U2935U2b05-U2b07U2b1b-U2b1cU3297U3299U303dU00a9U00aeU2122U23f3U24c2U23e9-U23efU25b6U23f8-U23fa" sample="This 🍒 is ⭐ a 🐢 line 🤮 of 😃 emoji ✈" echo $sample echo $sample | LC_ALL=UTF-8 sed -e "s/[$(printf $emoji)]//g" The preceding script can obtain normal execution results on other Linux operating systems (such as centos).…

VIEW QUESTION

Redis – Parsing file names to get python package names consistently

Need some scripting help. Here is the problem. I have a set of python packages (files) beautifulsoup4-4.12.2-py3-none-any.whl certifi-2023.7.22-py3-none-any.whl charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl google-3.0.0-py2.py3-none-any.whl idna-3.4-py3-none-any.whl protobuf3-0.2.1.tar.gz protobuf-3.19.6-py2.py3-none-any.whl proton-0.9.1.tar.gz python-qpid-proton-0.38.0.tar.gz redis-4.5.5-py3-none-any.whl requests-2.31.0-py3-none-any.whl robotframework-6.1.1-py3-none-any.whl robotframework_requests-0.9.1-py3-none-any.whl robotframework-run-keyword-async-1.0.8.tar.gz soupsieve-2.5-py3-none-any.whl urllib3-2.0.7-py3-none-any.whl I need to parse each file name to…

VIEW QUESTION

Ubuntu – How to sed the "\" in variable in bash

The following bash is used to replace the "$source_product" with "$source_product" + "linefeed" + "$target_product". Here is the bash script: source_product="$(LOCAL_DIR)/source \" target_product="$(LOCAL_DIR)/target \" echo "source_product: $source_product" echo "target_product: $target_product" echo "" echo "--- replace source with source+target ---" echo…

VIEW QUESTION
Back To Top
Search