What error messages did you get when you tried to compile your code? Did it complain about the symbols exexlp and prinf not being found? Did it complain about there not being any function prototypes for fork, wait, execlp, printf, exexlp, and prinf?
If you actually got an executable file named example1, why wouldn't you try executing ./example1? You showed us that you attempted to run ./first.c and there is no reason to think that a C source code file should be executable; but trying to execute it should have given you one or more diagnostic messages.
If you actually succeeded in running example1 (which, from what you have shown us, I doubt), is there an executable named yyy on your search path? Since you aren't checking the return codes on any of the functions you're calling, why would you believe that any of the functions you're calling are doing what you expected them to do?
I strongly suggest that you first get rid of all of the compilation warnings and errors in the code you're trying to compile before you try running any object file compiling it creates. Then try running the object file created; not the source file.
What error messages did you get when you tried to compile your code? Did it complain about the symbols exexlp and prinf not being found? Did it complain about there not being any function prototypes for fork, wait, execlp, printf, exexlp, and prinf?
If you actually got an executable file named example1, why wouldn't you try executing ./example1? You showed us that you attempted to run ./first.c and there is no reason to think that a C source code file should be executable; but trying to execute it should have given you one or more diagnostic messages.
If you actually succeeded in running example1 (which, from what you have shown us, I doubt), is there an executable named yyy on your search path? Since you aren't checking the return codes on any of the functions you're calling, why would you believe that any of the functions you're calling are doing what you expected them to do?
I strongly suggest that you first get rid of all of the compilation warnings and errors in the code you're trying to compile before you try running any object file compiling it creates. Then try running the object file created; not the source file.
This is what I get when trying to run the object
Though I did add the error that showed when I tried to run the first.c file:
I didn't get what wrong in this line
Though I did add the error that showed when I tried to run the first.c file:
I didn't get what wrong in this line
Sorry, I missed that. I was thinking that you got it from running example1. What it wrong is that you can't execute source code. You have to compile it first and run the executable code that is produced from that source. But, as I implied with all of the questions about what errors you got when you tried to compile first.c (which you still haven't answered), I'm not at all surprised that you didn't get an executable file named example1. Fix all of the errors in your source code (missing #include lines for the headers that contain the prototypes for the functions you're using, misspelled function names, incorrect types on function arguments, and strongly consider checking return codes on functions like wait, execlp, and fork.
Note that fork returns 0 in the child after a successful fork, -1 after a failed fork, and the PID of the child to the parent after a successful fork. Just checking for non-zero doesn't give you enough information to understand what is going on in your code.
I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing,
$ echo $SHELL
/bin/bash
$ printf "
> SET serveroutput ON trimspool on feed off echo off
> declare
> p_val number;
> d_val varchar2(10);
> begin
> SELECT... (1 Reply)
Hello,
You might help a newbie like me, I am trying to run a .sh inside my shell script. After running that I need to execute below commands. Here's how my scripts looks like. Hope you can help:
#!/bin/sh
cd $ORACLE_HOME/owb/bin/unix
./OMBPlus.sh ---> goes to OMB+> directory
cd... (10 Replies)
Hi guys I have a problem with one module of my script. It's awk script running in pbs file - It's working when I make a call from pbs to separate awk only file like this but when I try to execute this code in pbs file it fails
awk 'BEGIN { max = -1000; min = 1000 }
{
{$4 == "TCO"}
... (2 Replies)
hai
i have a directory lib
in that lib directory i have 10 batch files.
step i have to do is 1) EXECUTE ALL THE FILES by using the command dwarfdump <filename>| grep DW_AT_SUN_command_line
and put the output in one text file.instead of executing the files for all the 10 files... (13 Replies)
I am running a shell file following script on bash shell in solaris 10
(
echo abc@orcl
echo abc
echo "set feedback off"
echo "truncate table SIndexDataTypeHst1_changes;"
) | sqlplus -s
but getting the following error
ERROR:
ORA-01005: null password given; logon denied
... (3 Replies)
Hello Gurus,
I've been tasked with solving a problem at my new job and I'm stumped. We've got a script that dynamically builds an oracle export parameter files and then runs export from the shell. it runs fine when using the shell, but will NOT run (fails in one spot everytime) when entered... (1 Reply)
Hello All,
After login to the server we are explicitly calling /usr/local/bin/bash to activate bash shell properly.
But since commands are not executing properly so I think it is not initialized well. I am facing following problems:
1) If I want to have a look on a particular file using tail... (6 Replies)
Dear All
I have file a.sql, let's say the content is:
_________________________________
select * from dual;
exit;
_________________________________
and I have shell script a.sh, the content is:
_________________________________
ORACLE_SID=testing; export ORACLE_SID... (0 Replies)
Hi,
I want to ask if anyone has any ideas, why the batch file i created to transfer files on my desktop doesn't run after i put this line in /etc/passwd and any idea to overcome it ? Thanks
user:!:xxx:xxx::/home/user:/usr/local/bin/ssh-dummy-shell (2 Replies)