LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2006, 06:34 AM   #1
Elguapo
Member
 
Registered: Mar 2005
Distribution: FC7
Posts: 42

Rep: Reputation: 15
Shell Scripting Help


I have setup a cron job that excecutes a shell script that I am using to collect RETS data on a 6 hour basis. With in side my shell script, I have some very simple things setup. SInce I am new to shell scripting, I am looking for a little bit of help.

Here is my shell script. Basically, I have four needs from this script.

1. Remove all .txt files from RETS collection directory
2. Collect RETS data (the script below does this correctly
3. After the script is done running the shell script orc.sh, I need it to rename the collected files to <name>.xml
4. Run a coldfusion script that I have, via a url.

Can someone point me in the right direction as to where I can information so I can accomplish these needs.

#!/bin/sh
#!/bin/bash


JAVA_HOME=/usr/java/jdk1.5.0_08
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH

/usr/local/orc-0.7.15/bin/orc.sh ARMLS
 
Old 09-07-2006, 07:03 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Maybe something like:
Code:
#!/bin/sh
# (You only need one shebang line)
# Comment out the line below after testing
set -xe
#1. Remove all .txt files from RETS collection directory
# Change "/RETS/collection/directory" placeholder to actual directory name with full path
find /RETS/collection/directory -type f -iname "*.txt"|xargs -iF rm 'F'
#
# 2. Collect RETS data (the script below does this correctly)
# Change "/path/to/script.sh" placeholder to actual script name with full path
/path/to/script.sh
# 3. After the script is done running the shell script orc.sh, I need it to rename the collected files to <name>.xml
# Change "/path/to/orc.sh" placeholder to actual script name with full path
/path/to/orc.sh
# 4. Run a coldfusion script that I have, via a url.
for cmd in curl links lynx; do
cmd=$(which $cmd 2>/dev/null)
[ -n "$cmd" ] && break; done
uri="proto://doma.in/script.cf"
${cmd:=echo} "${uri}"
# Always exit script properly:
exit 0
Some Bash scripting guides, you'll prolly want the first two:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 03:32 PM
Help with Shell Scripting. eggoz Linux - General 2 04-21-2003 01:15 PM
Shell Scripting, I think... AMDPwred Linux - General 1 04-06-2002 12:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration