can I change/su user in the middle of a script?
if [ \"$user\" == \"\" ]; then echo \"Enter the table name\"; read user fi gunzip * chown postgres * su pos
No you can't. Or atleast... you can su but su will simply open a new shell at that point and when it's done it will continue with the rest of the script.
One way around it is to use su -c 'some command'
su -c 'some command'