Home / Microsoft / Microsoft DOS / Running Script
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: 1 2 [All] - (Bottom) Print
Author Topic: Running Script  (Read 1132 times)
sya
Topic Starter
Greenhorn



Posts: 9


« on: December 12, 2009, 06:11:52 AM »

Hi,

I am *censored* beginner in MS DOS. :)
Im currently using command prompt to telnet to this one server by using ftp.
Before, i'm runninng prepared script to download data from this one server.
the script is in .sh file (eg, script.sh)
the problem is, suddenly i got this one message saying "permission denied" when i tried to run the script like usually i did.
can you help me in solving this?
perhaps i can get any command line that i can use to get rid the error message.
Thank you in advanced.
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #1 on: December 12, 2009, 06:41:07 AM »

.sh scripts are Linux/Unix aren't they?
IP logged


Proud to be European
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #2 on: December 12, 2009, 07:02:16 AM »

@salmon .sh, by defacto, are considered shell scripts BUT they can mean anything.
@OP, you are not making sense. describe your problem clearly. you telnet to the server by using ftp and then you run the script?? show us how you do that.
IP logged

Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #3 on: December 12, 2009, 07:12:54 AM »

@salmon .sh, by defacto, are considered shell scripts BUT they can mean anything.

I am not sure what you mean. The sh extension is commonly used in 'nix systems for Bash (or other shell) scripts. Given the OP's mention of 'script.sh' I think I made a reasonable point.

IP logged


Proud to be European
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #4 on: December 12, 2009, 07:18:35 AM »

yup, i telnet the server and make directory. then only i run the script. the command is as below:

telnet xx.xx.xx.xx
cd xx/xx/xx
script.sh

until this point, the error msg saying "permission denied" pop out.
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #5 on: December 12, 2009, 07:27:32 AM »

What operating system are you using?
IP logged


Proud to be European
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #6 on: December 12, 2009, 07:34:52 AM »

and the script is sumthing like below:

#!/bin/ksh
USER='xxxx'
PASSWD='xxxx'
NOW=$(date '+%Y-%m-%d')
YDAY=$(TZ=CST+24 date +%Y%m%d)
mkdir RHSH_ALARM_$NOW
ftp -n xx.xx.xx.xx <<SCRIPT
user $USER $PASSWD
binary
lcd RHSH_ALARM_$NOW
cd xx/xx/xx
prompt
mget $NOW*.csv
bye
SCRIPT
IP logged
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #7 on: December 12, 2009, 07:36:24 AM »

operating system? ???
window xp?
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #8 on: December 12, 2009, 07:38:20 AM »

operating system? ???
window xp?

Then this is surprising

Quote
#!/bin/ksh

IP logged


Proud to be European
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #9 on: December 12, 2009, 07:40:02 AM »

i just dun understand..
sorry that i really2 a beginner in this..
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #10 on: December 12, 2009, 07:54:34 AM »

1. sh scripts run on Unix systems.
2. Unix is not Windows or MS-DOS.
3. You posted in MS-DOS forum.
4. Probably wrong or expired password. Contact your system administrator.
IP logged


Proud to be European
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #11 on: December 12, 2009, 08:01:53 AM »

i see.. thanks so much.. i'll get u back if i'm not able to solve this.. :D
IP logged
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #12 on: December 12, 2009, 08:19:19 AM »

I am not sure what you mean. The sh extension is commonly used in 'nix systems for Bash (or other shell) scripts. Given the OP's mention of 'script.sh' I think I made a reasonable point.


what i mean is, you can practically name your file with any extension you want, it doesn't mean anything. You can name a shell script without .sh and it will still work.
However, in IT world, every one (almost) knows what the extension normally stands for, (hence defacto).
IP logged

Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #13 on: December 12, 2009, 08:57:38 AM »

Ok, but script.sh and forward slashes in paths kindof says "not Windows", don't you think? And "#!/bin/ksh" at the top of the script says "Korn shell - UNIX!!!" rather loudly.


IP logged


Proud to be European
ghostdog74
Mentor



Thanked: 26
Posts: 1,511


« Reply #14 on: December 12, 2009, 09:13:45 AM »

Ok, but script.sh and forward slashes in paths kindof says "not Windows", don't you think? And "#!/bin/ksh" at the top of the script says "Korn shell - UNIX!!!" rather loudly.

my first thought is he is  telnetting to a unix machine. Otherwise, it might be possible that he is running cygwin or something. anyway, OP has to get his gears together and explain clearly one more time what he is doing.
IP logged

Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #15 on: December 12, 2009, 09:18:03 AM »

I wondered about cygwin too.
IP logged


Proud to be European
sya
Topic Starter
Greenhorn



Posts: 9


« Reply #16 on: December 12, 2009, 08:28:35 PM »

ghostdog, i'm actually being a client for this one server.
what i do is to telnet a server, then from there i go into ftp server to do downloading certain files. in order to go into the ftp server and thus do downloading, i usually run a prepared script saved in ftp client. again, my command line is sumthing like below:

telnet XXX.XXXX.XXXX.XXXX [ip address of server]
script.sh

usually, files will appear in the ftp client and i can download it into my pc.
but now, what happened was that i couldnt even run the script as error saying "permission denied" appears.
hopefully u can get what i mean. ;)
IP logged
Pages: 1 2 [All] - (Top) Print 
Home / Microsoft / Microsoft DOS / Running Script « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.1 seconds with 19 queries.