|
|
2010-05-28
, 11:54
|
|
Posts: 161 |
Thanked: 70 times |
Joined on Feb 2010
|
#2
|
| The Following User Says Thank You to acvetkov For This Useful Post: | ||
|
|
2010-05-28
, 11:58
|
|
Posts: 130 |
Thanked: 24 times |
Joined on Jan 2010
@ Israel
|
#3
|
| The Following User Says Thank You to StOoZ For This Useful Post: | ||
|
|
2010-05-28
, 12:14
|
|
Posts: 12 |
Thanked: 14 times |
Joined on May 2010
|
#4
|

|
|
2010-05-28
, 12:56
|
|
Posts: 12 |
Thanked: 14 times |
Joined on May 2010
|
#5
|
|
|
2010-05-28
, 16:52
|
|
|
Posts: 546 |
Thanked: 85 times |
Joined on Feb 2008
@ Winnipeg, Canada
|
#6
|
cp -r test.txt /home/user/MyDocs
|
|
2010-05-28
, 16:59
|
|
Posts: 1,141 |
Thanked: 781 times |
Joined on Dec 2009
@ Magical Unicorn Land
|
#7
|
|
|
2010-05-28
, 17:02
|
|
Posts: 12 |
Thanked: 14 times |
Joined on May 2010
|
#8
|
|
|
2010-05-28
, 17:09
|
|
|
Posts: 1,034 |
Thanked: 784 times |
Joined on Dec 2007
@ Annapolis, MD
|
#9
|
Ok, another thing.
how can i tell him to copy from the script folder, and not from his current folder?
I tried with script_dir=$(dirname $0), and then
cp -r $script_dir/test.txt /home/user/MyDocs
it doesn't work.
how can I call the script folder to copy from it?
|
|
2010-05-28
, 17:33
|
|
Posts: 47 |
Thanked: 18 times |
Joined on Jun 2008
|
#10
|
ok, I just run it with:
sh /home/user/MyDocs/hw.sh
and i works - thanks
I prefer not to mess with the permissions yet.
and thanks for the fi comment
especially if you are using a different system to write your scripts. You will use them more than you probably care to as you move scripts from one system to another.
You can get away with out the conversion sometimes, but as in your case don't count on it.
one folder to another.
from what I read saw and on other scripts, it shuld start with the shebang "#!/bin/sh", end with "fi" and be saved as a *.sh file.
I created a little "Hello World!" script:
i get the line:
-sh: /home/user/MyDocs/hw.sh: Permission Denied
what am I doing wrong?