Sponsored Content
Top Forums Shell Programming and Scripting Issues while trying to run a shell script using the command sh <filename.prog> Post 302982012 by venkatesh17 on Thursday 22nd of September 2016 12:19:21 PM
Old 09-22-2016
Issues while trying to run a shell script using the command sh <filename.prog>

Hi,

I'm facing issues while trying to run a sample program on Linux.
If I try to run the script using the command "sh <filename.prog>", it doesn't work. But, if I try to execute it using the command "ksh <filename.prog>", it works fine.

Even ". ./filename.prog" works fine.

Can you please help in fixing this and make the file execute using the command "sh <filename.prog>".

Code:

Code:
#!/bin/sh
  
 printf "%s\n" "set pages 0 serverout on feed off" \
          "SELECT sysdate from dual;" \
           |sqlplus -s username/password \
           |{ read var1; }
echo "date is " $var1


Last edited by Corona688; 09-22-2016 at 01:45 PM.. Reason: Adding code .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to run shell command and insert results to existing xml file

Hi. Thanks for any help with this. I'm not new to programming but I am new to shell programming. I need a script that will 1. execute 'df -k' and return the volume names with specific text 2. surround each line of the above results in opening and closing xml tags 3. insert the results of step... (5 Replies)
Discussion started by: littlejon
5 Replies

2. Shell Programming and Scripting

shell script prog help

How to write a program to store the list of ordinary files and the directory files in the specified directory in two files called dir.dat and ord.dat. Then print the largest directory and largest file? (1 Reply)
Discussion started by: rameshparsa
1 Replies

3. Programming

how to run prog bet to break points

Hi, I have set two break points at 500 and 572 lines respectively. after running prog using (gdb) run i m on the line 500 but how two go to second breakpoints ie line 572 . when i m giving (gdb) run it is asking again to run from starting lines . (1 Reply)
Discussion started by: useless79
1 Replies

4. Shell Programming and Scripting

how to call java prog from shell script

I have a java program to validate a XML file. I want to call this java program in a shell script which will be registered as concurrent program in oracle apps. Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps... (1 Reply)
Discussion started by: kcp_pavan
1 Replies

5. Shell Programming and Scripting

Execute a shell script after a particular command is run

Hi, I need to run a script whenever the Cron file is modified. The requirement is whenever a user modifies the cron file, the script should run automatically. Can you please provide your inputs ? (5 Replies)
Discussion started by: harneet2004us
5 Replies

6. Shell Programming and Scripting

Shell script to run command + compare values and post a warning message.

Hi all, I am trying to create shell script to run command then compare values with rule set for every 5 seconds and post a warning message if the compared value meet the rules. -the script is related to Oracle/Sun product messaging server 6.2 1) command that need to be run to gather... (2 Replies)
Discussion started by: Mr_47
2 Replies

7. Shell Programming and Scripting

run command in a script shell

Hello, Please i'd like to run command in a script shell , how can i do ? here my commands : cd blcr-build // run command in this rep sudo insmod ./blcr_imports/kbuild/blcr_imports.ko //root sudo insmod ./cr_module/kbuild/blcr.ko //root Thank you. (1 Reply)
Discussion started by: chercheur857
1 Replies

8. Shell Programming and Scripting

Help me!how to run autosys command in UNIX shell script

Hi all, Here is my scenario.. i need to get dates from an existing autosys calendar and compare it with current date with in a unix shell script. Please help me out and give me an approach to handle this....... the general autosys calendar command used is autocal_asc ,but this is... (1 Reply)
Discussion started by: shrik12345
1 Replies

9. Shell Programming and Scripting

Perl program to run a Shell script issues...

Hi all, I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran. I get an error, of course, since I don't know what I'm doing really. Here is the code: #!/opt/perl/bin/perl -w ... (14 Replies)
Discussion started by: zixzix01
14 Replies

10. Shell Programming and Scripting

Replace string works on command-line but fails when run from shell script

I wish to replace "\\n" with a single white space. The below does the job on command-line: $ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g'; /fin/app/scripts /fin/app/01/sql However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies
PAM_MAKE(8)							 Reference Manual						       PAM_MAKE(8)

NAME
pam_make - PAM module which calls make SYNOPSIS
pam_make.so [debug] [nosetuid] [make=prog] [log=file] /path/ [...] DESCRIPTION
pam_make is a PAM module that can be used to run make in a given directory. OPTIONS
debug Print debug information. log=file The output of make is appended to file nosetuid Per default pam_make.so will execute make with the effective user ID of the calling process. Specifying this option means make is run with the real user ID. make=prog The command prog is used instead of make. MODULE SERVICES PROVIDED
The services auth, account, password and session are supported. RETURN VALUES
PAM_SUCCESS The make command runs successfull. PAM_SERVICE_ERR No argument or a wrong number of arguments were given. PAM_SYSTEM_ERR A system error occured or the make command failed. PAM_IGNORE pam_setcred was called, which does not execute the make command. EXAMPLES
Add the following line to /etc/pam.d/passwd to rebuild the NIS database after each local password change: passwd optional pam_make.so /var/yp This will execute the command: make -C /var/yp HISTORY
The first implementation of pam_make was written by Mihai Ibanescu <misa@dntis.ro>. SEE ALSO
pam.conf(5), pam.d(8), pam(8) AUTHOR
pam_make was written by Thorsten Kukuk <kukuk@thkukuk.de>. Reference Manual 10/25/2006 PAM_MAKE(8)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy