Using the eval utility to evaluate user supplied strings allows the user to run anything the script has permission to run. There is no problem if all of the strings passed to eval were generated by the application itself and it knows what it is doing. (The eval utility constructs a command by concatenating arguments together, separating each with a <space> character and then having the shell read and execute the constructed command. So you've got tokenization, command parsing, tilde expansion, parameter expansion, command substitution, arithmetic expansion, field splitting, pathname expansion, quote removal, and I/O redirections that can all trip up an unwary script writer.)
---------- Post updated at 06:46 PM ---------- Previous update was at 06:24 PM ----------
Quote:
Originally Posted by nitrobass24
I have to use KSH88, so going to BASH, perl etc. is not an option.
Below is a much simplified verison of what I am doing (aka ignore my cut command and i not increasing)
Namerefs are not available in KSH88
So how else i can accomplish the same thing? I need to echo a string through cut and set it to an increasing variable name based on $i then call the new variable.
I'm assuming that the code you have here isn't doing what you want. When I run the commands:
in a recent ksh, I get the output:
I would have thought you would want something more like:
which produces the following:
which will work in any ksh88 or later Korn shell and in any POSIX conforming shell (including ksh and bash).
I don't know if anyone is interested but I have been meddling with FFT for the AMIGA.
(Sadly we AMIGAns don't have these luxuries through any scripting language.
Below is a Python snippet that uses the builtin 'cmath' module to work with the lowly
Python 2.0.1 for the AMIGA. It is part of a... (0 Replies)
Hello,
I want to pick a random element from a list, and created these 2 lines, which work very well in ksh93. Unfortunately, I get this "bad substitution" message in ksh88.
I'm wondering if there's an equivalent to the second line of my script.. or if I have to install ksh93 to make this... (8 Replies)
Hi I tried the following code to FTP the files from test server to dev
#!/bin/ksh
DST=/home/files
cd $DST
ftp -inv 'test_serv101' << EOF
quote USER test
quote PASS test
# File Path on test server
cd /etc/home/Or_Files
ascii
mget curMonth* $DST
quit
EOF
when i try the above code it... (4 Replies)
I'm using Ksh88 .
I've last day files in one directory and current month files in another directory , having the same naming convention.
Now i need to compare these folders size , if there is no change in these files then no action to be performed
else if there is a change then i need to call... (1 Reply)
Hi I tried the following string comparison script in Ksh88
#!/bin/ksh
str1='aC'
str2='ABC'
if
then
echo "Equal"
else
echo "Not Equal"
fi
Though str1 and str2 are not equal the script output says Equal .
Please correct me
Thanks (2 Replies)
Hi,
With:
# VALUES="one~two~~~"
# echo $VALUES | awk 'BEGIN {FS="~"} {print NF}'
5
I can determine the number of fields.
How to determine the number of fields with a value ?
In this case 2.
Thanks in advance,
ejdv (6 Replies)
Hello,
I need ksh88 for my linux system - and I don't want pdksh.
Possible to get original ksh 88 binaries or source ?
(I don't need ksh93 which is available)
thanks
Vilius (1 Reply)
I was wondering if there is anyway to use the curses library with ksh88. I saw Shell Curses function library which says I can use /usr/local/functions/shellcurses on ksh93 but I am on ksh88. I am on a HP-UX box. (0 Replies)