Sponsored Content
The Lounge What is on Your Mind? Echo eval xargs and other siblings Post 303031580 by nezabudka on Saturday 2nd of March 2019 06:05:57 AM
Old 03-02-2019
Thanks @Corona688,
stdin> this is the shell stdin
I was hoping that it would be clear from the context that the stdin> is the entrance to the shell. I guess I need to work on the design of the presentation. Smilie
It seemed to me funny, for example, "echo" and "eval" commands. Both commands take parameters and do the same work. Only the first returns a string of them to the stdout and the second command to the stdin (shell stdin).
I'v added the feature of Xargs, above noted to my notes.

Last edited by nezabudka; 03-02-2019 at 07:58 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using eval w/ echo

My script has the following for loop in it. foreach id (CLKM4 DGTM4 GNNM4) eval echo $id \$${id}sf \$${id}sfk end so "id" is a variable defined in the loop, and "idsf" and "idsfk" are variables defined in another part of the script, they return values of 0 or more. The problem i'm... (2 Replies)
Discussion started by: wxornot
2 Replies

2. Shell Programming and Scripting

EVal

Hi All, I'm running some encrypted data through a script I wrote. In order to do this, I'm using eval to resolve some of my variables. At the moment, when I use eval to resolve, it strips out some of my encrypted values, and totally drops some others. For example if I have the value ab1"3 it drops... (1 Reply)
Discussion started by: Khoomfire
1 Replies

3. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

4. UNIX for Dummies Questions & Answers

Definition of "siblings" in /proc/cpuinfo

So, I'm looking over /proc/cpuinfo and have a question... I've read that "siblings" refers to hyperthreading, but that seems odd considering the contents of cpuinfo. Here's a part: model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz physical id : 0 siblings : 4 core... (1 Reply)
Discussion started by: treesloth
1 Replies

5. UNIX for Dummies Questions & Answers

'echo dir_path | xargs cd' does not work?

Hi: how come this command does not work? the error message is: xargs: cd: No such file or directory yet, in the same time, 'echo dir_path | xargs ls' works. Does it work in bash? We use csh. Thanks. NB Phil (7 Replies)
Discussion started by: phil518
7 Replies

6. Shell Programming and Scripting

echo file deleted by xargs

my command deletes the oldest file from a folder and I'd like to have some type of output when the file is selected or deleted. ls -t -1 | tail -n 1 | xargs rm I'm not sure how to incorporate echo into this. Thanks, (2 Replies)
Discussion started by: evanlivingston
2 Replies

7. Shell Programming and Scripting

Strange result of eval, how does eval really work with ssh?

Hi all, some small script with eval turned me to crazy. my OS is linux Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux below script works well #!/bin/bash eval ssh remotehost date eval ssh remotehost ls below... (1 Reply)
Discussion started by: summer_cherry
1 Replies

8. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (1 Reply)
Discussion started by: vivek d r
1 Replies

9. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (13 Replies)
Discussion started by: vivek d r
13 Replies

10. Shell Programming and Scripting

Eval

thank you (35 Replies)
Discussion started by: ratnalein88
35 Replies
EVAL(3) 								 1								   EVAL(3)

eval - Evaluate a string as PHP code

SYNOPSIS
mixed eval (string $code) DESCRIPTION
Evaluates the given $code as PHP. Caution The eval(3) language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option than to use this construct, pay special attention not to pass any user provided data into it without properly validating it beforehand. PARAMETERS
o $code - Valid PHP code to be evaluated. The code mustn't be wrapped in opening and closing PHP tags, i.e. 'echo "Hi!";' must be passed instead of '<? echo "Hi!"; >'. It is still possible to leave and reenter PHP mode though using the appropriate PHP tags, e.g. 'echo "In PHP mode!"; ?>In HTML mode!<? echo "Back in PHP mode!";'. Apart from that the passed code must be valid PHP. This includes that all statements must be properly terminated using a semicolon. 'echo "Hi!"' for example will cause a parse error, whereas 'echo "Hi!";' will work. A return statement will immediately terminate the evaluation of the code. The code will be exe- cuted in the scope of the code calling eval(3). Thus any variables defined or changed in the eval(3) call will remain visible after it terminates. RETURN VALUES
eval(3) returns NULL unless return is called in the evaluated code, in which case the value passed to return is returned. If there is a parse error in the evaluated code, eval(3) returns FALSE and execution of the following code continues normally. It is not possible to catch a parse error in eval(3) using set_error_handler(3). EXAMPLES
Example #1 eval(3) example - simple text merge <?php $string = 'cup'; $name = 'coffee'; $str = 'This is a $string with my $name in it.'; echo $str. " "; eval("$str = "$str";"); echo $str. " "; ?> The above example will output: This is a $string with my $name in it. This is a cup with my coffee in it. NOTES
Note Because this is a language construct and not a function, it cannot be called using variable functions. Tip As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example). Note In case of a fatal error in the evaluated code, the whole script exits. SEE ALSO
call_user_func(3). PHP Documentation Group EVAL(3)
All times are GMT -4. The time now is 03:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy