function theURL = cisc106URL(lab,filename) %cisc106URL return the URL where a file can be retrieved on the web % % consumes: % lab: a string containing lab number (e.g. 'lab08') % filename: a string with the file to put on the web (e.g. 'myplot.jpg'); % % produces: % theURL: a string with a URL under user's public_html/cisc106 % % notes: (1) the userid is taken from result of the 'whoami' command, % so this function only works on Unix systems. % (2) the userid portion of the result will vary from user % to user. In the sample output, jsample is used as the userid % % % examples: % >> cisc106URL('lab08','myplot.jpg'); % ans = 'http://copland.udel.edu/~jsample/cisc106/lab08/myplot.jpg' % >> % >> cisc106URL('lab09','temperature.jpg'); % ans = 'http://copland.udel.edu/~jsample/cisc106/lab09/temperature.jpg' % >> % % the following command will ONLY work on strauss % This sets the variable % myUsername to my own username on strauss. I need that to % form a message with the URL of the web page [status, myUsername] = system('whoami'); % remove any extra space at start and end of myUsername myUsername = strtrim(myUsername); % set up a string with the URL on the web, and print a message theURL = ['http://copland.udel.edu/~' myUsername '/cisc106/' ... lab '/' filename ]; return; end