Sponsored Content
Top Forums Shell Programming and Scripting Help executing command loaded from file Post 302298493 by GoldenEye4ever on Tuesday 17th of March 2009 04:39:49 PM
Old 03-17-2009
Thanks a lot cfajohnson,
you rule Smilie

But now I have another question Smilie

I've got my attributes evaluated, however I need to consider if multiple attributes are passed through, as a single string Smilie

Basically, I need to tokenize the parameters string

This is what I have so far:
Code:
...
evalParams()
{
  output=""
  input="$1"
  set -A attr $(echo ${input} | tr ',' ' ' )
  
  n="0"
  while [ "${n}" -lt "${#attr[*]}" ];
  do
    eval "p=${attr[${n}]}"
    output="${output} ${p}"
    n=`expr $n + 1`
  done
  
  echo ${output}
}
...
## this is actually loaded from file, but for the purpose of an example it's fine :)
parameters="`date +%m%d`,`date +%H%M`"
...
params=`evalParams ${parameters}`

Unfortunately, it isn't working Smilie
The attr array isn't being populated as I expected,
the entrie parameter string just gets assigned to the 1st index (index 0)



As for cronjobs, we're trying to get our scheduling in the DB.
- We want our schedules to be centralized
- Makes learning the timings of the batch easier

Last edited by GoldenEye4ever; 03-18-2009 at 01:50 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

executing *.bat file on windows from Unix box via ftp command

I have created get_list.bat file containing following line: dir /B /O-d >file_list.txt I am executing ftp command from Unix box and transferring get_list.bat file to windows server. In my next ftp command I am trying to execute this test.bat file by entering this line: get_list or by... (9 Replies)
Discussion started by: alx
9 Replies

2. Shell Programming and Scripting

How can I make the for command check to see if a file is empty before executing?

Here is the command in question for f in $(<uploads); do . I only want this to execute if uploads is not empty. If uploads is empty I want the script to quit, actually before the for command. If its not apparent uploads is a text file. Chris (3 Replies)
Discussion started by: chrchcol
3 Replies

3. Shell Programming and Scripting

Help shell script to loop through files update ctl file to be sql loaded

I am currently trying to find a way to loop through files in a given directory and for each file modify a ctl file and sql load it. I have been using the sed command to change the infile, badfile parameters of the control file. I have not yet tried to sql load it. Requirement: files are ftp to... (1 Reply)
Discussion started by: dba_nh
1 Replies

4. Shell Programming and Scripting

waiting until file loaded

Hello i have DB file load with this command ../SS-Tools/SSdbload -r 10 -il /export/specbackup_db/$b y i should wait until the DB load completed then run the next command $SPECROOT/bin/launchinstdbapp `/usr/bin/hostname` SS n VNM.OUT how this can be done with shell scripting NB: i... (1 Reply)
Discussion started by: mogabr
1 Replies

5. UNIX for Dummies Questions & Answers

Problem executing find file command in Linux

When trying to find a list of files with specific text in them using find . -type f -exec grep -l "DataStage Job 4263" {}\; I get error find: missing argument to 'exec' How can I correct this ? I'm on Linux Red Hat. Cheers PS I'm a DataStage programmer not a systems support... (4 Replies)
Discussion started by: jackdaw_at_work
4 Replies

6. Shell Programming and Scripting

Check if file is loaded completely and then process the file

I need to write a script which checks for files loaded into a folder (files are loaded by ftp from other server) and process the file only if the file is loaded completely. if the file is not complete in the current run, it must be processed in the next run. Any suggestions would be welcome... (2 Replies)
Discussion started by: kalyan381
2 Replies

7. Shell Programming and Scripting

How to get total records loaded from sqlldr log file

Hi, I am loading data in the database table through sqlldr. I have to find total records loaded from sqlldr log file and store it in a variable in my script. How do I get it? Thank you. (3 Replies)
Discussion started by: mrpranab
3 Replies

8. Solaris

file just loaded does not appear to be executable

Hi When i m trying the boot the system with Primary HDD (c1t0d0s0) -- its solaris 10 I m getting an error "file just loaded does not appear to be executable".....So will anyone share the steps to recover from this stage I also tried to build the corrupted superblock from below command but... (0 Replies)
Discussion started by: taruntan
0 Replies

9. UNIX for Dummies Questions & Answers

Find command not executing for copying file

Buddies, I am trying to copy the file 'xcopyq' from /home/sandip to /home/sandip/testdir using the below command and getting the error as shown below:- sandip@manu:~$ find /home/sandip -type f -name '*xcopyq*' -exec cp{} /home/sandip/testdir/ \: find: missing argument to `-exec' Am I... (2 Replies)
Discussion started by: sandip250382
2 Replies

10. UNIX for Dummies Questions & Answers

Write pid and command name to a txt file while executing a bash script

Hi All, Just have a requirement, I am executing a bash shell script, my requirement is to catch the pid and job name to a txt file in the same directory, is there anyway to do it? please help me out. Regards Rahul ---------- Post updated at 08:42 AM ---------- Previous update was at... (2 Replies)
Discussion started by: rahulkalra9
2 Replies
PTHREAD_ATTR(3) 					   BSD Library Functions Manual 					   PTHREAD_ATTR(3)

NAME
pthread_attr_getschedparam, pthread_attr_setschedparam -- thread attribute operations SYNOPSIS
#include <pthread.h> int pthread_attr_getschedparam(const pthread_attr_t *restrict attr, struct sched_param *restrict param); int pthread_attr_setschedparam(pthread_attr_t *restrict attr, const struct sched_param *restrict param); DESCRIPTION
Thread attributes are used to specify parameters to pthread_create(). One attribute object can be used in multiple calls to pthread_create(), with or without modifications between calls. pthread_attr_getschedparam() and pthread_attr_setschedparam() get and set the scheduling parameters within the attr argument. See /usr/include/sched.h for the definition of struct sched_param. The sched_priority field of struct sched_param must be within the range returned by the sched_get_priority_min(2) and sched_get_priority_max(2) system calls. RETURN VALUES
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. pthread_attr_getschedparam(), on success, will copy the value of the thread's scheduling parameter attribute to the location pointed to by the second function parameter. ERRORS
pthread_attr_getschedparam() will fail if: [EINVAL] Invalid value for attr. pthread_attr_setschedparam() will fail if: [EINVAL] Invalid value for attr. [ENOTSUP] Invalid value for param. SEE ALSO
pthread_create(3), pthread_attr_init(3), pthread_attr_setinheritsched(3) STANDARDS
pthread_attr_setschedparam(), pthread_attr_getschedparam() conform to Version 2 of the Single UNIX Specification (``SUSv2'') BSD
December 31, 2007 BSD
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy