cannot copy file using scp when filename has ":"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cannot copy file using scp when filename has ":"
# 1  
Old 02-18-2008
Error cannot copy file using scp when filename has ":"

hi all ,

does any one know how can we copy a file using scp which have a file name inlcuding "+:"
example :

ls -lrt *.csv | tail -3
-rw-r----- 1 opern oper 8479 Feb 15 15:39 LKILA.csv
-rw-r----- 1 opern oper 8479 Feb 18 12:06 L+KILA.csv
-rw-r----- 1 opern oper 8479 Feb 18 12:07 L+:KILA.csv
$ scp L*.csv sqa2wrk2@tcenh038:.
scp L*.csv sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
L+KILA.csv 100% 8479 8.3KB/s 00:00
LKILA.csv 100% 8479 8.3KB/s 00:00

if see above the files LKILA.csv L+KILA.csv can be copied but not L+:KILA.csv
how to over come that those special chars !!
i tried with backslaash

$ scp L\+\:KILA.csv sqa2wrk2@tcenh038:.
scp L\+\:KILA.csv sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
# 2  
Old 02-18-2008
Try using double backslash.
# 3  
Old 02-18-2008
the colon will be interpreted as unix path, like : scp file.log root@server:/opt/folder/ - that's why it will fail, use double backslash as you've been advised, try using "" around the file, or last resort - rename it Smilie
# 4  
Old 02-19-2008
hi ,
thank you very much for your suggetions , but still no luck yet
i have tried all combinations

wblvq2ol2s-opern:/pet2/opern> scp L\\+:KILA.csv sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp " L\\+:KILA.csv" sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp "L\\+:KILA.csv" sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp L\\+:KILA.csv sqa2wrk2@tcenh038:.
ssh: L+: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp "L\\+\\:KILA.csv" sqa2wrk2@tcenh038:.
ssh: L+ scp: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp L\\+\\:KILA.csv sqa2wrk2@tcenh038:.
ssh: L+ scp: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp L+\\:KILA.csv sqa2wrk2@tcenh038:.
ssh: L+ scp: no address associated with name
wblvq2ol2s-opern:/pet2/opern> scp "L+\\:KILA.csv" sqa2wrk2@tcenh038:.
ssh: L+ scp: no address associated with name
wblvq2ol2s-opern:/pet2/opern>
# 5  
Old 02-19-2008
use "./" without quotes before ur file.
eg with file name L+:KILA.csv
execute this
scp ./L+:KILA.csv sqa2wrk2@tcenh038:.


Anchal.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 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. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Copy particular file using "ls -ltr"

Hi all, I am new in shell scripting and trying to write a script which does the following: #!/bin/bash $PATH =/a/b/c ls -ltr $PATH $VARIABLE=??? $ls -ltr $PATH -rw-r--r-- 1 18401 1399 127474 Apr 13 07:21 file_abc_1.txt -rw-r--r-- 1 18401 1399 127474 July 13 07:21 file_abc_2.txt... (2 Replies)
Discussion started by: emily
2 Replies

4. 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

5. 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

6. Shell Programming and Scripting

"~" comes in filename after file copy

I have a windows n/w share mapped to a unix path. I am trying to copy the file from one unix location to this location using "cp" command. After I copy the copy and check the filename logging through unix, I can see it as expected. But, when I check the file from Windows at the n/w share, the... (10 Replies)
Discussion started by: khuman
10 Replies

7. 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

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

9. AIX

CP to copy file is "stuck"

For some reason, when I attempt to copy a file, using cp, from one location to another the cmd is stuck (or taking an unusually long time). Usually copying a 1 GB file will take 3-4 mins, so far it's at 11 mins and yesterday was stuck for several hours. Is there a way I can see WHY or WHAT is... (5 Replies)
Discussion started by: mcubitt
5 Replies
Login or Register to Ask a Question