I have written a shell script which would prompt the user to enter some name and a folder would be created by that name.
This script should run automatically when the users provide there credentials during a FTP session and for every FTP session.
And after they have provided there credentials they should be inside this newly created folder. Is this possible? If yes, how can I achieve this?
This is the main bugaboo with using cd inside a script... the cd <path> has to have <path> be absolute to always work correctly. Otherwise you have a bigger problem trying to get to the directory.
The other problem is that sometimes users want to go where no man has gone before - so mkdir and cd will fail. You have to check return status if [ $? -eq 0 ] --- everytime you do anything with what originated as user input. User input has to be considered poison. Unfortunately.