# \*nix filename with VI problem

**URL:** <https://forums.suse.com/t/nix-filename-with-vi-problem/23660>\
**Category:** Chatting over the Back Fence\
**Created:** [February 21, 2013, 8:23pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660 "2013-02-21T20:23:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)\
**Post date:** [February 21, 2013, 8:23pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/1 "2013-02-21T20:23:00Z")

</div>

Any ideas on how to open a file named 1234-12-1234 in vi?  
Can’t seem to get it to interpret the dashes. I could rename it, edit it and  
rename it back to what it is but seems a bit daft to do it that way.

---

<div class="post-metadata">

**Author:** ![Hspeirs](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Hspeirs](https://forums.suse.com/u/Hspeirs)\
**Post date:** [February 21, 2013, 8:27pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/2 "2013-02-21T20:27:28Z")

</div>

On 2/21/2013 12:23 PM, GofBorg wrote:[color=blue]

> Any ideas on how to open a file named 1234-12-1234 in vi?  
> Can’t seem to get it to interpret the dashes. I could rename it, edit it and  
> rename it back to what it is but seems a bit daft to do it that way.
> 
> [/color]

vi 1234\-\12\-1234

H.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 8:45pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/3 "2013-02-21T20:45:01Z")

</div>

Haitch wrote:  
[color=blue]

> On 2/21/2013 12:23 PM, GofBorg wrote:[color=green]
> 
> > Any ideas on how to open a file named 1234-12-1234 in vi?  
> > Can’t seem to get it to interpret the dashes. I could rename it, edit it  
> > and rename it back to what it is but seems a bit daft to do it that way.
> > 
> > [/color]
> 
> vi 1234\-\12\-1234
> 
> H.[/color]  
> Oooo I was so close…

vi 1234\-\12\-\1234

I see my mistake now. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 8:45pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/4 "2013-02-21T20:45:53Z")

</div>

Haitch wrote:  
[color=blue]

> On 2/21/2013 12:23 PM, GofBorg wrote:[color=green]
> 
> > Any ideas on how to open a file named 1234-12-1234 in vi?  
> > Can’t seem to get it to interpret the dashes. I could rename it, edit it  
> > and rename it back to what it is but seems a bit daft to do it that way.
> > 
> > [/color]
> 
> vi 1234\-\12\-1234
> 
> H.[/color]  
> Hmmm…didn’t work either.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 8:48pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/5 "2013-02-21T20:48:46Z")

</div>

> Haitch wrote:[color=blue]  
> [color=green]
> 
> > On 2/21/2013 12:23 PM, GofBorg wrote:[color=darkred]
> > 
> > > Any ideas on how to open a file named 1234-12-1234 in vi?  
> > > Can’t seem to get it to interpret the dashes. I could rename it, edit it  
> > > and rename it back to what it is but seems a bit daft to do it that way.
> > > 
> > > [/color]
> > 
> > vi 1234\-\12\-1234
> > 
> > H.[/color]  
> > Hmmm…didn’t work either.[/color]

Normally in such a case I would just do vi 1234\* but there are numerous  
files beginning with 1234…too many to open/close.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 8:55pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/6 "2013-02-21T20:55:45Z")

</div>

I found the issue. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 9:01pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/7 "2013-02-21T21:01:44Z")

</div>

GofBorg wrote:  
[color=blue]

> Any ideas on how to open a file named 1234-12-1234 in vi?  
> Can’t seem to get it to interpret the dashes. I could rename it, edit  
> it and rename it back to what it is but seems a bit daft to do it  
> that way.[/color]

vi “1234-12-1234”

–  
Does this washcloth smell like chloroform?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 9:12pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/8 "2013-02-21T21:12:41Z")

</div>

> [color=blue]  
> vi “1234-12-1234”[/color]

That works as well. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 21, 2013, 9:49pm UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/9 "2013-02-21T21:49:24Z")

</div>

On Thu, 21 Feb 2013 19:12:41 +0000, GofBorg wrote:

[color=blue][color=green]

> > vi “1234-12-1234”[/color]
> 
> That works as well. Thanks.[/color]

Opened fine here on a Linux box without quotes or escaping any characters.

Jim

–  
Jim Henderson, CNA6, CDE, CNI, LPIC-1, CLA10, CLP10  
Novell Knowledge Partner

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 22, 2013, 12:47am UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/10 "2013-02-22T00:47:33Z")

</div>

On 02/21/2013 12:49 PM, Jim Henderson wrote:[color=blue]

> On Thu, 21 Feb 2013 19:12:41 +0000, GofBorg wrote:
> 
> [color=green][color=darkred]
> 
> > > vi “1234-12-1234”[/color]
> > 
> > That works as well. Thanks.[/color]
> 
> Opened fine here on a Linux box without quotes or escaping any characters.[/color]

Yeah, there is nothing special about a hypen/dash in the filesystem. Use  
tab-completion if nothing else, but my guess is that something about those  
characters is non-standard, like they’re odd hyphens that you can get from  
stupid word processors… like curly-quotes that show up in nice ASCII  
text files and look broken because they’re non-ASCII. In that case merely  
typing the hyphen directly could fail because, literally, its not the same  
character. Again, tab-completion

vi 1  
#then press [tab]

Good luck.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 22, 2013, 1:45am UTC](https://forums.suse.com/t/nix-filename-with-vi-problem/23660/11 "2013-02-22T01:45:49Z")

</div>

On Thu, 21 Feb 2013 22:47:33 +0000, ab wrote:  
[color=blue]

> On 02/21/2013 12:49 PM, Jim Henderson wrote:[color=green]
> 
> > On Thu, 21 Feb 2013 19:12:41 +0000, GofBorg wrote:
> > 
> > [color=darkred]
> > 
> > > > vi “1234-12-1234”
> > > 
> > > That works as well. Thanks.[/color]
> > 
> > Opened fine here on a Linux box without quotes or escaping any  
> > characters.[/color]
> 
> Yeah, there is nothing special about a hypen/dash in the filesystem.[/color]

Well, there’s one time it’s a problem - as the first character in the  
filename, or (OK, two) after a space in the filename if the space isn’t  
properly escaped.

Jim

–  
Jim Henderson, CNA6, CDE, CNI, LPIC-1, CLA10, CLP10  
Novell Knowledge Partner
