nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

calling a script within a script

This is a discussion on calling a script within a script within the Shell scripting forums, part of the Development/Scripting category; how do i go about calling a already existing script that i wrote from a script that i am currently ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 03-13-2008, 12:50 PM
Junior Member
User
 
Join Date: Feb 2008
Location: Linn County, Iowa
My distro: Ubuntu
Posts: 10
Rep Power: 0
Predatorian is on a distinguished road
Send a message via AIM to Predatorian Send a message via MSN to Predatorian Send a message via Yahoo to Predatorian
Default calling a script within a script

how do i go about calling a already existing script that i wrote from a script that i am currently writing? i want to call an awk script that i wrote, but i cant remember the syntax.
__________________
Gigabye GA-MA790X-DS4 AM2+
VGA XFX 8800 512mb
AMD Phenom 9500 2.2gh AM2
G-Skill 2x2gb
FSP Blue Storm 500w
Plextor DVD+/- RW
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-04-2008, 04:07 PM
Junior Member
User
 
Join Date: Apr 2008
My distro: red hat
Posts: 1
Rep Power: 0
dheerajkabra is on a distinguished road
Default

first, you have to add something like following in your awk script:

PATH=:/bin:/usr/bin:/sbin:/usr/sbin=$PATH
export PATH

and then make the permission on the script as 755
and then put in the /sbin folder

and then when you need to call this script from another script, you should call it smething like:

/sbin/<awk_script>

<<<<<<You have to mention the absolute path to your awk script.
lemme know if it works.
ALSO if you come accross any other efficient workaround, then please do let me know.
Reply With Quote
  #3 (permalink)  
Old 04-07-2008, 02:59 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Code:
#!/bin/bash
echo "My Host script"
echo "Calling AWK script..."
/path/to/awk/script.awk
#or try
awk -f /path/to/script
# or try
awk -f /path/to/script /path/to/data/file.txt
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
linux script williamcty Shell scripting 0 12-20-2007 01:48 PM
problem in script sania Getting started tutorials 0 09-14-2007 05:25 PM
script for mailing to user the o/p of the script ricc Shell scripting 3 07-11-2007 05:59 AM
Need this script karabaja Shell scripting 8 06-23-2006 05:55 AM
cut script ricc Shell scripting 4 08-11-2005 10:59 AM


All times are GMT +5.5. The time now is 03:18 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36