summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJan Steffens <jan.steffens@gmail.com>2010-06-15 17:41:14 +0200
committerJan Steffens <jan.steffens@gmail.com>2010-06-19 02:05:18 +0200
commitae111aae812059091b864b38c241f5ce93b8e9c2 (patch)
tree9335e4803ec9144883b7929126191d132e380acf /functions
parenta1c547e7e8e5c4a420a763451eb6af49b329af68 (diff)
downloadmkinitcpio-ae111aae812059091b864b38c241f5ce93b8e9c2.tar.gz
mkinitcpio-ae111aae812059091b864b38c241f5ce93b8e9c2.tar.xz
sed cleanup
Replace some seds with tr and bash pattern removal
Diffstat (limited to 'functions')
-rw-r--r--functions8
1 files changed, 4 insertions, 4 deletions
diff --git a/functions b/functions
index 91145f1..4bdb27e 100644
--- a/functions
+++ b/functions
@@ -8,7 +8,7 @@ auto_modules ()
[ -n "$m" ] && mods="$mods $m"
done
- echo "${mods}" | sed 's|-|_|g'
+ echo "${mods}" | tr '-' '_'
[ -z "${mods}" ] && return 1
return 0
}
@@ -26,7 +26,7 @@ checked_modules ()
{
if [ -e "${MODULE_FILE}" ]; then
for mod in $(all_modules $@); do
- modname="$(basename ${mod%%\.ko} | sed 's|-|_|g')"
+ modname="$(basename ${mod%.ko} | tr '-' '_')"
if grep "^${modname}$" "${MODULE_FILE}" >/dev/null 2>&1; then
echo ${modname}
fi
@@ -147,9 +147,9 @@ add_module ()
{
local m fil path fw mod deps
#cleanup - remove .ko, replace - with _
- m=$(basename "${1}" | sed -e 's|-|_|g' -e 's|\.ko$||g')
+ m=$(basename "${1%.ko}" | tr '-' '_')
#find pattern - replace _ with [-_] to match either
- fil=$(echo "$m" | sed -e 's|_|\[-_\]|g')
+ fil=$(echo "$m" | sed 's|_|\[-_\]|g')
found=0
for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do