Question: What is the difference between the 2 lines below? They do the same thing so is there any difference ?

```
string filename = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
string filename = FileUpload1.PostedFile.FileName;

```

Answer: 
In BASH you can use this utility function:

```
decodeURL() {
   printf "$(sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;' <<< "$@")\n";
}

```

**Then call this function as:**

```
decodeURL 'file:///home/sashoalm/Has%20Spaces.txt'
/home/sashoalm/Has Spaces.txt

```
GNU awk

```perl
#!/usr/bin/awk -fn
@include "ord"
BEGIN {
  RS = "%.."
}
{
  printf RT ? $0 chr("0x" substr(RT, 2)) : $0
}

```

Or 

```
#!/bin/sh
awk -niord '{printf RT?$0chr("0x"substr(RT,2)):$0}' RS=%..

```

[How to decode URL-encoded string in shell?](https://stackoverflow.com/q/6250698/#14000368)