Greetings family.
I started writing this in order to present a problem I was having. But while articulating my problem I hit on a workaround that mostly works. I am posting it because I think it may solve a similar problem for someone else.
I have an SQL script that runs a bunch of delete commands. I want to pepper it with messages and time stamps. Logging in as myself I can do this:
dbaccess sysmaster -
> !echo Delete from table yutz at $(date +"%Y-%m-%d %H:%M:%S")
Delete from table yutz at 2026-09-22 11:48:28
So it works as I would like it to in the script. I peppered the SQL script with the same !echo command. I got these errors at every !echo command:
stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
Variable syntax
Ok, lemme back up and run this in an interactive dbaccess session, as user informix this time. (The script MUST run as user informix.)
dbaccess sysmaster -
Database selected.
> !echo Delete from table yutz at $(date +"%Y-%m-%d %H:%M:%S")
Variable syntax
Well, at least no stty messages. The main difference between my login and the informix login is that my default shell is ksh and informix's shell is csh. But I get the same error even when I have exec's to ksh before starting the dbaccess session. It would appear that each !echo command is spawning a C-shell and csh does not like that command. I tested this as myself running csh:
% echo Delete from table yutz at $(date +"%Y-%m-%d %H:%M:%S")
Variable syntax
I realized that dbaccess is spawning the default shell of the user (be it informix or myself). And each invocation of csh runs .cshrc, which has a bunch of stty commands. These barf because, in my script, the STDIN to dbaccess is a pipe. Hence the stty errors. I can live with this. But what about the "variable syntax" errors?
At first I went googling for a csh equivalent to the $(command) syntax. But since Google flooded me with useless solutions to different problems, I came up with a workaround in the sql script:
!printf "Delete from table yutz at ";date +"%Y-%m-%d %H:%M:%S" -- Table name changed, of course
Note: No \n in the printf command. Thus, I get this in the output:
stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
Delete from table yutz at 2026-09-22 12:36:08
BTW, if I redirect 2>/dev/null, the date does not show up either.
As to how to spawn a csh instance without executing the .cshrc (and getting those stty errors)? That is not an informix issue. But if a csh expert on this forum chooses to give me a hand with a easy way to skip the .cshrc, I tip my yarmulka to you. ;-)
I hope it's at least been an interesting read.
------------------------------
+-----------------------------------------------------------+
| I am pleased to report that I had no problems today. |
| I had only issues, opportunities, challenges and valuable |
| learning experiences. |
+------------------------------------------ Jacob S --------+
------------------------------