bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Budi
Subject:
Date: Mon, 22 Mar 2021 09:50:06 +0000

The conditional variable not work in function in a script ie ~/.bashrc
while works in shell term.

$ unset u;h=0; o=(${h:+ ! -path "./*.txt"}) ;u=($u "${o[@]}"); c=(.
-regextype posix-extended "${b[@]}" -print); find "${c[@]}"

or type

$ k(){ unset u;h=0; o=(${h:+ ! -path "./*.txt"}) ;u=($u "${o[@]}");
c=(. -regextype posix-extended "${b[@]}" -print); find "${c[@]}" ;}

$ k
works

in a function k() in  ~/.bashrc

k(){ unset u;h=0; o=(${h:+ ! -path "./*.txt"}) ;u=($u "${o[@]}"); c=(.
-regextype posix-extended "${b[@]}" -print); find "${c[@]}"
 }

in output set -x:

+ unset u
+ h-0
+ o=(${h:+ ! -path "./*.txt"})
+ u=($u "${o[@]}")
+ c=(. -regextype posix-extended "${b[@]}" -print)
+ find . -regextype posix-extended ' ! -path ./*.txt' -print
find: paths must precede expression: ` ! -path ./*.txt'

Why and how to solve ?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]