help with a script (fedora)


 
Thread Tools Search this Thread
Operating Systems Linux help with a script (fedora)
# 1  
Old 08-02-2011
help with a script (fedora)

hi there,
i am trying to make a script in which i can drag a file (with spaces in file name Smilie) and it will scp the file to another computer

my code is

Code:
echo "--------------------------------------------"
echo "drag file now"
echo "--------------------------------------------"
read "file"
echo "$file"
v="scp ""$file"" prince:/home/prince"
echo $v
$v
echo "press any key and hit enter to terminate"
read buffer

i am getting
Code:
[root@localhost lucifer]# '/home/lucifer/Scripts/fast_scp.sh' 
--------------------------------------------
--------------------------------------------
drag file now
--------------------------------------------
'/home/lucifer/Downloads/Oasis - Wonderwall (Tyler Ward Acoustic Cover).webm' 
'/home/lucifer/Downloads/Oasis - Wonderwall (Tyler Ward Acoustic Cover).webm'
scp '/home/lucifer/Downloads/Oasis - Wonderwall (Tyler Ward Acoustic Cover).webm' prince:/home/prince
root@prince's password: 
'/home/lucifer/Downloads/Oasis: No such file or directory
-: No such file or directory
Wonderwall: No such file or directory
(Tyler: No such file or directory
Ward: No such file or directory
Acoustic: No such file or directory
Cover).webm': No such file or directory
press any key and hit enter to terminate
s
[root@localhost lucifer]#

any body please help me out to get this going, i am kinda noob in shell scripting.
# 2  
Old 08-03-2011
try the below

Code:
 
v="\"scp ""$file"" prince:/home/prince\""

# 3  
Old 08-03-2011
Give a Shot At this Code

Try this code

echo "--------------------------------------------"
echo "drag file now"
echo "--------------------------------------------"
read "file"
echo "$file"
v=`scp -r "$file" root@prince:/home/prince`
echo $v
echo "press any key and hit enter to terminate"
read buffer

Smilie
# 4  
Old 08-03-2011
@sundar

Code:
 
-r                  Recursively copies entire directories.

here the lucifer is having the problem with the file which has the space in the name
# 5  
Old 08-03-2011
:)

Didnt Notice that one Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash on Fedora error on basic script

I am not able to execute bash script on Fedora. They were running on another environment. This is a sample script: #!/usr/bin/bash input="./data/heu/hout1" i=1 j=0 while IFS= read -r file1 do #Some code here done < "$input" #echo $j I get an error: bash: s.sh: command not... (3 Replies)
Discussion started by: ngabrani
3 Replies

2. Linux

Fedora 14

Anyone know where I can obtain a reliable download of Fedora 14? Every one I have attempted to download charges a fee and a credit card. I have the fee but no credit card. Plus I don't want a prepaid card for just a one-time purchase. :wall: This is how I feel. LOL Any advice? Thank... (4 Replies)
Discussion started by: aeo0868
4 Replies

3. Red Hat

Fedora startup script help

Can someone please tell me how to run a fedora startup script? I read these guides and tried to do what they said with no luck. Create a Startup Script Custom Startup Script | Open Source Club at Ohio State University This is what I put in my startup script. #!/bin/bash # chkconfig:... (6 Replies)
Discussion started by: cokedude
6 Replies

4. Red Hat

fedora grub help, moving to tri boot (XP, ubuntu, fedora soemething)

I will shortly be adding a fedora flavor to my devel box. I currently have XP (installed first on an ssd), ubuntu 10.04 (installed second on the first partition of a platter drive), and I want to add either Cent or SL on the second partition of the platter drive. I will probably also want to... (0 Replies)
Discussion started by: LMHmedchem
0 Replies

5. Linux

Dual Boot Win XP And Fedora with Fedora Installed First

Hi everyone, I hope this question goes here. Anyways, I have a unique situation where my friend's comp has Fedora installed and wants to add Win XP as a dual boot without formatting the drive. Is it possible to create a partition on the current hard drive and then install win xp? I couldn't find... (4 Replies)
Discussion started by: eltinator
4 Replies

6. Ubuntu

Fedora 7

Hi all, Have installed Fedora 7 at home on an oldish Acer 3500. No sound and currently using what I think is a 15inch monitor (not entirely sure). Anyways, was curious to know what others "do" on their home setups. I've been more used to logging into work's HP-UX machines for the most part in... (3 Replies)
Discussion started by: Cameron
3 Replies

7. Linux

my c++ script in fedora

to all loving friends i have some scripts in c++, i need to compile and run in fc 2 pls how i can run my scrips from CUI, and from GUI ? can anybody help me (1 Reply)
Discussion started by: sadiquep
1 Replies

8. UNIX for Dummies Questions & Answers

Fedora to be or not to be?

Hiya folks, I been browsing through the forums on information regarding Fedora. I know this is the version I want but what is holding me back now is whether my computer could run it easily? I'am asking this because alot of the forum posts and replies I have read, most of them ask for the... (2 Replies)
Discussion started by: Mr_Pinky
2 Replies

9. Linux

FEDORA HELP(please)

I RECENTLY LOADED FEDORA LINUX ALL 4CD/S(FULL INSTALL). but i am getting no sound,no proper help documentation.what should i do. Please help. (7 Replies)
Discussion started by: ameya_shaligram
7 Replies
Login or Register to Ask a Question