История изменений
Исправление
nexfwall,
(текущая версия)
:
[nexfwall@PCG31311V-LF02 ~]$ bash -x test
+ file=/tmp/tst
+ sep='$'
++ wc -l
++ grep -o '\$' /tmp/tst
+ num=6
+ echo 'Debug: num: [6]'
Debug: num: [6]
[nexfwall@PCG31311V-LF02 ~]$ cat /tmp/tst
$$
$
$$$
[nexfwall@PCG31311V-LF02 ~]$ cat test
#!/bin/bash -x
file='/tmp/tst'
sep='$'
num=$(grep -o "\\$sep" "$file" | wc -l )
echo "Debug: num: [$num]"
Оно?
Исходная версия
nexfwall,
:
[nexfwall@PCG31311V-LF02 ~]$ bash -x test
+ file=/tmp/tst
+ sep='$'
++ wc -l
++ grep -o '\$' /tmp/tst
+ num=6
+ echo 'Debug: num: [6]'
Debug: num: [6]
[nexfwall@PCG31311V-LF02 ~]$ cat /tmp/tst
$$
$
$$$
Оно?