"Cannot Execute" script, SunOS. [solved]


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting "Cannot Execute" script, SunOS. [solved]
# 1  
Old 06-11-2012
"Cannot Execute" script, SunOS. [solved]

I have a script in Server A that will run a script in ServerB.

Code:
    #!/bin/ksh/
    ssh user@server "/path/script.sh"

The script permissions are as follow:

Code:
 -rwxrwxrwx   1 user    dba           75 Jun 11 10:00 script.sh

I checked the existence of 'ksh' in /bin and its there. (bash isnt)

When I try to run the script I get
Code:
./script.sh: cannot execute

What could be happenning? I tested the ssh command manually and it works.

Its a SunOS system.

---------- Post updated at 09:54 AM ---------- Previous update was at 09:51 AM ----------

The damn slash at the end of #!/bin/ksh was causing the problem. Smilie
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. Post Here to Contact Site Administrators and Moderators

"SunOS/Solaris Links" Sticky thread need an update

7 out of 8 links in one of the two Solaris Sticky threads are dead: https://www.unix.com/solaris/17943-sunos-solaris-links.html Could a moderator update them or unlock the thread to allow contributors to provide up to date replacement links ? (3 Replies)
Discussion started by: jlliagre
3 Replies

3. Shell Programming and Scripting

[Solved] Error While Using "Basename" in the Script

Hello All My Requirement is to Delete files in a particular directory based on its extension. So for that i have piece of Code down below horo=`date +%Y%m%d` logfile=/temp/log.file.$horo date >> $logfile for fulldir in 'ls -ld /temp/strs/*' do dir=`basename $fulldir` case $dir in... (3 Replies)
Discussion started by: Ajesh
3 Replies

4. Solaris

[HW] Script so that when i execute the "rm" command

Hi guys, I need to write a script so that when i execute the "rm" command, the file mentioned need to be copied to other folder and then be deleted. this should be done in back ground. can you please help me out?? I have written a code in c for this but i dont have C compiler and i dont... (0 Replies)
Discussion started by: rajeshb6
0 Replies

5. Homework & Coursework Questions

[Solved] Shell script "whoson" sorta...

Shell script "whoson" Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: write a script that will tell you who is logged in the unix system here by using the... (1 Reply)
Discussion started by: csharp100
1 Replies

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

7. Shell Programming and Scripting

Difficulty using "execute immediate" in shell - Sql script

Hello members, I get an unexpected "end of file" error while trying to execute the following piece of code in the bash / ksh shell. I'm assuming the problem is with using the "execute immediate statement" #! /bin/bash tname="table" for i in * do sqlstr="create table $tname$i as select... (3 Replies)
Discussion started by: novice82
3 Replies

8. Shell Programming and Scripting

how do execute "vi" commands in shell script?

Hi All, I need to execute the following "vi" commands in my script. How can I do that?? pls help me.... 1. escape (escape mode) 2. gg (goto first line) 3. shift+v (visual mode) 4. shift+g (goto to last line) 5. = (alinment) Thanks in advance, Saravana (3 Replies)
Discussion started by: askumarece
3 Replies

9. Solaris

significance of "+" char in SunOS "ls -l" output

Hi, I've noticed that the permissions output from "ls -l" under SunOS differs from Linux in that after the "rwxrwxrwx" field, there is an additional "+" character that may or may not be there. What is the significance of this character? Thanks, Suan (6 Replies)
Discussion started by: sayeo
6 Replies

10. Shell Programming and Scripting

if [[ "$(uname)" = "SunOS" ]]

What does the following script do? if ] ; then PATH="/usr/xpg4/bin:${PATH}" if ] ; then alias expr="/usr/ucb/expr" fi fi (1 Reply)
Discussion started by: neeto
1 Replies
Login or Register to Ask a Question