How to include a command in shell script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to include a command in shell script?
# 1  
Old 09-02-2009
How to include a command in shell script?

[root@server01 ~]# dbc "delete from alert;"
DELETE 10
[root@server01 ~]#

However, the script created below generates an error that command does not exits. Can any one please exist.

script.sh:
#!/bin/sh
dbc "delete from alert;" >>$TASKLOGFILE


./script.sh: line 38: dbc: command not found

can any one please assist.

Thanks
# 2  
Old 09-02-2009
you will need to include the path information
Code:
#!/bin/sh
/path/to/dbc "delete from alert;" >>$TASKLOGFILE



---------- Post updated at 03:22 PM ---------- Previous update was at 03:18 PM ----------

If you don't know the path to the dbc program, you can try
Code:
find / -name dbc -print

Code:
which dbc

# 3  
Old 09-02-2009
Excellent and thank you very much.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to include menu based options in Shell script?

Hi Friends, I have a menu based tool which requires input/option to proceed further. How to make a shell script ? eg: menu looks like Get_data.sh to continue (y/n) : Here I need to key in "y" to proceed. I want to prepare a script which should consider option y. (5 Replies)
Discussion started by: suresh3566
5 Replies

2. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

3. Shell Programming and Scripting

Apache Hosting-Shell Script - external files include

Hi there Well, it's my first time on this board, so short to myself: I'm matibaski, working as a webdeveloper and also as a system administrator on ubuntu server machines. The problem: I created a small apache-hostingscript by myself and it works fine. But after some addings and new... (1 Reply)
Discussion started by: matibaski
1 Replies

4. Shell Programming and Scripting

my sed how to include my sftp command!

Hi All, I'm a newbie here, i'm just wondering how can i include my sftp command, here is my code. see below. test -f /home/1.txt && sed -i "s/$/&,pogi" /home/1.txt my sftp command: how can i insert my sftp command in my code above? sftp ${USER}@${HOST} <<-EOF cd ${INPUT_DONE} ... (0 Replies)
Discussion started by: nikki1200
0 Replies

5. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

6. UNIX for Dummies Questions & Answers

du command to include history

I used du -hk to determine the file sizes on several projects in CVS for a developer i am supporting and he asked me to include history for these projects to get total file size. Was du -hk correct to determine the total size? ---------- Post updated at 09:09 AM ---------- Previous update... (2 Replies)
Discussion started by: Frostywheat
2 Replies

7. UNIX for Dummies Questions & Answers

Include PERL script with in the unix shell script

Hi Gurus, Is it possible to include perl script with in the unix shell script? What would be the general syntax? In the above case, is it required to write the below first two lines of codes? #!usr/bin/sh -x #!usr/bin/perl -w Thanks in advance / Mysore Ganapati. (1 Reply)
Discussion started by: ganapati
1 Replies

8. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

9. Shell Programming and Scripting

how to include spreadsheet::ParseExcel in shell script

Please tell me that how can we include Spreadsheet::ParseExcel module in shell script (1 Reply)
Discussion started by: akash
1 Replies

10. Programming

How to include shell script in C program

hi I want to call a shell script in C program the script is : ssh -t user@remote sh /<remote>home/user/<file_name>.sh and other several commands C program : Call this script and the retrive the task that is been done in <file_name>.sh file can any one tell me how... (5 Replies)
Discussion started by: mridula
5 Replies
Login or Register to Ask a Question