Search Results

Search: Posts Made By: Morelia
14,433
Posted By Corona688
Something more like your code: ...
Something more like your code:

data_file_123="whatever"
PARAM="123"
VAR="data_file_${PARAM}"
[ -f "${!VAR}" ] && echo "The file ${!VAR} exists"
14,433
Posted By Corona688
If you have a new enough ksh, you can do things...
If you have a new enough ksh, you can do things like this:

$ NAME="VAR"
$ VAR="1234"
echo "${!NAME}"
1234
$ If you don't, it's going to be ugly:

$ data_file_123=sales.dat
$ PARAM="123"
$...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy