You are not logged in.

#1 2016-11-14 12:52:13

acura
Member
Registered: 2007-07-08
Posts: 21

Run find from variable (bash, sh)

Why does this work:

f="find ."
$f

And this not?

f="find . -name '*'"
$f

In the first working case I get something from find.
In the second gives nothing. It have nothing to do with dash/minus since f="find . -type f" works fine.

Offline

#2 2016-11-14 12:57:18

acura
Member
Registered: 2007-07-08
Posts: 21

Re: Run find from variable (bash, sh)

Seems to be the same with:

NAME="-name '*'"
find . $NAME

Offline

#3 2016-11-14 13:02:36

acura
Member
Registered: 2007-07-08
Posts: 21

Re: Run find from variable (bash, sh)

Seems like it have something to do with this: http://serverfault.com/questions/707269 … n-variable

Offline

#4 2016-11-14 14:20:03

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,857
Website

Re: Run find from variable (bash, sh)

Please use the edit button instead of repeatedly bumping your topic.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB