# Escaping Forward Slash

**URL:** <https://community.unix.com/t/escaping-forward-slash/368697>\
**Category:** Shell Programming and Scripting\
**Created:** [October 8, 2017, 6:00am UTC](https://community.unix.com/t/escaping-forward-slash/368697 "2017-10-08T06:00:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvinoo](https://community.unix.com/letter_avatar/alvinoo/32/6_449c533f586939b6e5f246632a46421f.png) [@alvinoo](https://community.unix.com/u/alvinoo)\
**Post date:** [October 8, 2017, 6:00am UTC](https://community.unix.com/t/escaping-forward-slash/368697/1 "2017-10-08T06:00:43Z")

</div>

```nohighlight
./split2.sh: line 1: split/ssl/pop3s.txt: No such file or directory
sort: cannot read: split/ssl/pop3s.txt: No such file or directory

```

Hi there,

I am pulling data from the following source:

```nohighlight
ssl/http
ssl/http
ssl/http-alt
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/ms-wbt-server
ssl/ms-wbt-server
ssl/pop3s

```

My Code I is taking from the list of data above. How can I escape it?

```nohighlight
for i in `cat commontypes.txt`;do cat *.grep|grep "open.*$i"|cut -d " " -f 2 > "split/$i.txt" ; sort -V "split/$i.txt" | sort -u ;done

```

---

<div class="post-metadata">

**Author:** ![RavinderSingh13](https://community.unix.com/letter_avatar/ravindersingh13/32/6_449c533f586939b6e5f246632a46421f.png) [@RavinderSingh13](https://community.unix.com/u/RavinderSingh13)\
**Post date:** [October 8, 2017, 6:51am UTC](https://community.unix.com/t/escaping-forward-slash/368697/2 "2017-10-08T06:51:18Z")

</div>

> [@alvinoo](#):
>
> ```plaintext
> ./split2.sh: line 1: split/ssl/pop3s.txt: No such file or directory
> sort: cannot read: split/ssl/pop3s.txt: No such file or directory
> 
> ```
> 
> Hi there,  
> I am pulling data from the following source:
> 
> ```plaintext
> ssl/http
> ssl/http
> ssl/http-alt
> ssl/https
> ssl/https
> ssl/https
> ssl/https
> ssl/https
> ssl/https
> ssl/ms-wbt-server
> ssl/ms-wbt-server
> ssl/pop3s
> 
> ```
> 
> My Code I is taking from the list of data above. How can I escape it?
> 
> ```plaintext
> for i in `cat commontypes.txt`;do cat *.grep|grep "open.*$i"|cut -d " " -f 2 > "split/$i.txt" ; sort -V "split/$i.txt" | sort -u ;done
> 
> ```

Hello alvinoo,

It is obvious error there could be 2 reasons for this error.

1st: Either you should have mention `/split` in case `/split` is a mount point.  
2nd: Or if your objective is to place files into current directory, where a directory named `split` is present. Then you have to make sure first directory split is present in current directory or make sure you have this directory present into your current directory.

Also your commands seems to be we could improve them in case you could let us know your complete objective like what you are trying to do with Input\_file's data? Please do let us know more details with all conditions and samples(in code tags), so that we could help you more.

Thanks,  
R. Singh

---

<div class="post-metadata">

**Author:** ![RudiC](https://community.unix.com/letter_avatar/rudic/32/6_449c533f586939b6e5f246632a46421f.png) [@RudiC](https://community.unix.com/u/RudiC)\
**Post date:** [October 8, 2017, 8:46am UTC](https://community.unix.com/t/escaping-forward-slash/368697/3 "2017-10-08T08:46:56Z")

</div>

What do you want to escape?  
What is `./split2.sh: line 1:` ?  
Does whatever your Code is work with the first eleven lines in your "source" (which I guess is called "commontypes.txt")?  
How is line 12 different?

---

<div class="post-metadata">

**Author:** ![alvinoo](https://community.unix.com/letter_avatar/alvinoo/32/6_449c533f586939b6e5f246632a46421f.png) [@alvinoo](https://community.unix.com/u/alvinoo)\
**Post date:** [October 8, 2017, 9:55am UTC](https://community.unix.com/t/escaping-forward-slash/368697/4 "2017-10-08T09:55:27Z")

</div>

> [@ravindersingh13](#):
>
> Hello alvinoo,
> 
> It is obvious error there could be 2 reasons for this error.
> 
> 1st: Either you should have mention `/split` in case `/split` is a mount point.  
> 2nd: Or if your objective is to place files into current directory, where a directory named `split` is present. Then you have to make sure first directory split is present in current directory or make sure you have this directory present into your current directory.
> 
> Also your commands seems to be we could improve them in case you could let us know your complete objective like what you are trying to do with Input\_file's data? Please do let us know more details with all conditions and samples(in code tags), so that we could help you more.
> 
> Thanks,  
> R. Singh

Hi Ravinder,

```plaintext
Split 

```

is in my current directory.  
When I face situation like

```plaintext
ssl/http

```

it does not work whereas example like without

```plaintext
/

```

can work
