What would be the shortest and easiest way to replace any instance of ~ with getenv("HOME") (returns the current user home directory) in a string? Im writing a little program that deals with system calls, but i need a way to tell C to do the same thing that bash does and expand ~ to the users home directory. I want to make the input foolproof so that the input can either enter /home/ or ~. THanks a lot in advance
-Nick