I have tried changing to $1, $2 as well as the $JAVA_TOP variable has been set. But still it is not working. When I echo $JAVA_TOP, it gives me the desired o/p, but cp doesnt work as it throws below error
XXEasyShipPage.java,$JAVA_TOP
XXEasyShipPage.java
$JAVA_TOP
JAVA_TOP is /dcypri/applmgr/common/java
cp XXEasyShipPage.java $JAVA_TOP/XXEasyShipPage.java
cp: cannot create regular file `$JAVA_TOP/XXEasyShipPage.java': No such file or directory
Kalpeer. Thanks for your reply. It worked, however the folder is not $JAVA_TOP always and will vary each time.
When I sed my filepath variable with same filepath variable, again i am not able to get it.
Is there a way to get this without hard-coding as $JAVA_TOP?
Hi kalpeer. This is just an example of how your code might be made to work. Your setup will only work with eval. Be advised though that the use of eval introduces a security risk, since anyone with access to your data file can have access to the rights of the person executing the script. Also in this case it relies on a environment variable and that can also possibly be manipulated. I would use a different setup that does not require the use of eval....