Skip to main content

Questions tagged [eval]

5 votes
2 answers
466 views

In the shell I can do $ a=b b=c; eval echo \$$a c How do I do the same with GNU Make's $(eval) function? $ cat Makefile a=b b=c x:; echo {What goes here in order to get:} $ make c
Dan Jacobson's user avatar
0 votes
1 answer
122 views

...that is to say, is there a means by which I can read the full command that's being evaluated AS it's happening? Here's a contrived example, but one I feel makes the question clear: function ...
NerdyDeeds's user avatar
0 votes
1 answer
196 views

I'm writing a shell script that changes its behavior based on the number of positional parameters passed script.sh if [ $# -eq 1 ]; then if [ -f "$1" ]; then validate='validate <&...
killua148's user avatar
0 votes
1 answer
133 views

I am writing a script to move around a bit of data, which I want to be able to create the parent directory to where I am sending my data, in order to do some renaming/cleaning of filenames I need to ...
Caesar's user avatar
  • 25
1 vote
0 answers
21 views

I'm trying to do a db backup script using Bash. When adding a "Resume" feature to the script, I do the following loop calling defined functions to do step by step (depending on the .lock ...
James's user avatar
  • 111
0 votes
2 answers
180 views

I run a game from steam which starts with the game companies launcher app where I have to click another button to start the actual game. The game launcher is very slow, contains needless advertising, ...
nobody special's user avatar
0 votes
2 answers
719 views

In bash 5.0, I wish to capture the ${PIPESTATUS[@]} of a piped command that is executed via eval. However, eval appears to mask ${PIPESTATUS[@]}, but doesn't mask $? which is the equivalent to ${...
jitter's user avatar
  • 117
0 votes
1 answer
1k views

Looking at a bash-script that takes input from Git commit comment to update itself. Simplified: script: #!/bin/bash comment='' printf '%s\n' "$comment" upgrade_script() { # ...
Err488's user avatar
  • 25
0 votes
1 answer
113 views

In a bash script: jenkins_folder=`cut -d "|" -f1 -s input.csv` jenkins_url='https://url.com:8181/jenkins/view/' echo "jenkins_folder : ${jenkins_folder}" for job in ...
Deepak Singhal's user avatar
4 votes
4 answers
819 views

I want a script to make awk to become an interactive mathematical calculator, to eval mathematical expressions given in each line. I.e., instead of constructing awk commands to calculate expressions ...
xpt's user avatar
  • 1,924
1 vote
1 answer
1k views

I am trying to automate adding Homebrew to my path in a shell script, but these two lines do not evaluate inside my shell script: #!/bin/sh eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)&...
unrealapex's user avatar
-1 votes
1 answer
125 views

I'd like to use a variable variablenaam for using in a loop. I tried for hours but can't make it work. My experiment in bash on a RPi 4 with the latest Raspbian. I like to make the use of xstack1 and ...
pvk's user avatar
  • 5
0 votes
1 answer
417 views

There is a way to declare variable in eval ? For example function test { eval $1 } test " value="foo" echo "$value" " But it display nothing. ...
RevOneX9's user avatar
0 votes
0 answers
314 views

Becuase I need to make sure I run authentication for my nohup commands I need the real command I want to run to be in a string in here: nohup sh -c 'echo $SU_PASSWORD | /afs/cs/software/bin/reauth; ...
Charlie Parker's user avatar
0 votes
2 answers
504 views

How to wrap a command to measure its elapsed time? Currently I do it using eval: do_cmd_named() { local name=$1 local cmd=$2 echo "$name" local start_time=$(date +%s) eval "$...
pmor's user avatar
  • 757

15 30 50 per page
1
2 3 4 5 6