HI,
I have a URL that points to a file:
LINK= "http://www.webpage.org/project/team2/file.tar"
However when I try to use wget on this variable I receive the following error.
wget $LINK
line 4: http://www.webpage.org/project/team2/file.tar: No such file or directory
wget: missing URL
The only way I can avoid the error is if I use wget against the URL directly
wget http://www.webpage.org/project/team2/file.tar
What I want to be able to do is two things:
- Take a URL and use wget against it
- Take the same URL and get the filename from it which in this case would mean printing "file.tar"
The reason that I mention the error is because I want to be able to assign the URL to a variable so I can use it in both cases because I do not want to have to input it twice.
Thanks!