Help understanding evaluation order


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help understanding evaluation order
# 1  
Old 03-25-2019
Help understanding evaluation order

I have made a simple script to find all programs that use a tcp wrapper, it will supply a reasonable default for my system if none is given.

After some digging I realized that the expansion operators pass their default return value single quoted (according to bash -x trace). I have wildcard expansions in my return value, and it works if used with eval.

Its working perfect with eval, but I don't know why.
# 2  
Old 03-25-2019
So please upload your entire script (wrapped in forum CODE tags) if you want help.

We are very talented here at unix.com; but reading minds and the work of other people "at an unseen distance" which we cannot imagine is not in our many skill sets.

Smilie
# 3  
Old 03-25-2019
thanks !

thanks !
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Evaluation of test command

Could somebody please explain to me why and how the highlighted line(s) (?) of code puts the "test" evaluation into "result" and then to $enable_static ? Or does not ? I did comment out the original code and changed it to what I feel is less cryptic , but the "result" is still wrong =... (3 Replies)
Discussion started by: anne
3 Replies

2. AIX

Older versions of the XL C/C++ Evaluation for AIX 5.3

Hello, IBM offers a evaluation version of their XL C/C++ compiler. Unfortunatly v16.1 (from Developerworks) can not be installed on AIX 5.3 (I can not upgrade my old 32 Bit RS/6000 to a later version) and I have not found any older versions on the IBM and Developerworks pages. Is there a... (8 Replies)
Discussion started by: eh2scqw
8 Replies

3. Shell Programming and Scripting

Help understanding evaluation order

I have made a simple script to find all programs that use a tcp wrapper, it will supply a reasonable default for my system if none is given. After some digging I realized that the expansion operators pass their default return value single quoted (according to bash -x trace). I have wildcard... (0 Replies)
Discussion started by: Riker1204
0 Replies

4. Shell Programming and Scripting

Bash regex evaluation not workin

I'm building a script that may received start and end date as parameters. I whant to make it as flexible as possible so I'm accepting epoch and date in a way that "date --date=" command may accept. In order to know if parameter provided is an epoc or a "date --date=" string I evaluate if the value... (2 Replies)
Discussion started by: lramirev
2 Replies

5. Cybersecurity

iptables latency evaluation

Hello guys, I'm actually working on my master thesis which has for subject the evaluation of virtual firewall in a cloud environment. To do so, I installed my own cloud using OpenNebula (as a frontend) and Xen (as a Node) on two different machines. The Xen machine is my virtual firewall thanks... (2 Replies)
Discussion started by: Slaughterman
2 Replies

6. UNIX for Dummies Questions & Answers

cp command evaluation

Hi all! I'm writting one script to copy a file in various folders, but there are 2 things to validate. First that the folder where i'll be cpying exists, and second that i have permissions to copy the file in it. so far i have found the way to validate the folder exists, but when trying to... (6 Replies)
Discussion started by: feliperivera
6 Replies

7. UNIX for Dummies Questions & Answers

Evaluation syntax in Unix commands

I know this should be simple, but sorry I am fairly new to UNIX and can't find the syntax to make this work. I have the following two commands in a script: x=`expr $(head -1 filename.ext | cut -c16 | grep | wc -l) + 16` del=`head -1 filename.ext | cut -c$x` This works fine as I expect... (2 Replies)
Discussion started by: DJR
2 Replies

8. Shell Programming and Scripting

Using AWK in IF evaluation in KSH

Hi - I have an expression that evaluates to "Alive" or some other condition. e.g. if I run :- awk -F \| '{gsub(/]*/,"",$4); print $4 }' then the output is "Alive". I want to be able to test this as the result may be some other condition other than "Alive". I have tried the following... (4 Replies)
Discussion started by: sniper57
4 Replies

9. Shell Programming and Scripting

AWK equation evaluation.

Hi, Is there a way to evaluate an equation contained in a string within an AWK script? For example: A = "(5*2)-1" (this equation is read from a file and varies line by line) In this example, I can't see any way to get an answer of 9 unless I do: cmd = "awk 'BEGIN{print "A"}'" cmd |... (3 Replies)
Discussion started by: srdgeo
3 Replies
Login or Register to Ask a Question