"Pipe" character in filename


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers "Pipe" character in filename
# 1  
Old 07-22-2011
"Pipe" character in filename

I received an external hd from a friend which contained folder names with the pipe character between words. I assumed he had used Unix to create the folders. I installed Cygwin believing I could rename the folders and all would be good. The emulator will bash the second and third words in the name after executing the mv command. I would think the emulator would work for this simple task. Any ideas?
# 2  
Old 07-22-2011
Examples of the problem, and the steps you've taken might help as a visual, but have you tried to encase the file and/or path given to mv with single-quotes (ie, mv -f 'bad|file|name.txt' '/tmp/bad/file/name.txt')? Oftentime, I've used this to alleviate problems caused by embedded spaces created by test scripts, etc.

I'd expect you'd also need to mv them another file system just to ensure you're not clobbering the input file...your original drive likely has no real directory structure beyond root, just a single listing of files with these pipes embedded.
# 3  
Old 07-22-2011
Quote:
Originally Posted by curleb
Examples of the problem, and the steps you've taken might help as a visual, but have you tried to encase the file and/or path given to mv with single-quotes (ie, mv -f 'bad|file|name.txt' '/tmp/bad/file/name.txt')? Oftentime, I've used this to alleviate problems caused by embedded spaces created by test scripts, etc.

I'd expect you'd also need to mv them another file system just to ensure you're not clobbering the input file...your original drive likely has no real directory structure beyond root, just a single listing of files with these pipes embedded.
"Pipe" character in filename-untitledpng
# 4  
Old 07-22-2011
Windows simply doesn't allow certain filenames in folders. *, |, ?, slashes and the like are forbidden. It's behavior when forced to deal with those filenames anyway is undefined.

What filesystem is the external drive?
# 5  
Old 07-22-2011
I thought the emulator would get me around it. I guess I'll have to find a Linux machine to rename the folders.
# 6  
Old 07-22-2011
Cygwin is not an emulator. It runs inside Windows and has all the same limits.

It would be really helpful to know what the external drive's filesystem was.

Try a Knoppix livecd. You can boot into a complete Linux system off DVD without installing anything on your computer.
# 7  
Old 07-22-2011
Quote:
Originally Posted by Corona688
Cygwin is not an emulator. It runs inside Windows and has all the same limits.

It would be really helpful to know what the external drive's filesystem was.

Try a Knoppix livecd. You can boot into a complete Linux system off DVD without installing anything on your computer.
That would explain it. I really appreciate that and I'll take your advice.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

3. UNIX for Dummies Questions & Answers

"tail -n 1 filename" error while "head -n 1 filename" is ok?

Hi all, I was wondering why tail -n 2 filename produce an error when I manage to do similar command on head -n 2 filename SunOS{type8code0}: tail -n 2 filename usage: tail ] tail ] (2 Replies)
Discussion started by: type8code0
2 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. UNIX for Dummies Questions & Answers

the meaning of "!:*" in "alias foo 'command\!:*' filename"

Hi: How can I remove my own post? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

6. Shell Programming and Scripting

Pipe to "xargs rm" : filename with spaces

Hi all, Am piping a list of files to "xargs rm -v". The files may have spaces in their names. Please advise how do i deal with it... :confused: Thanks. (3 Replies)
Discussion started by: coolatt
3 Replies

7. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

8. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

9. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

10. Shell Programming and Scripting

removing the "\" and "\n" character using sed or tr

Hi All, I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example... this is a test line #1\ should be concatenated with line #2\ and line number 3 when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies
Login or Register to Ask a Question