Sponsored Content
Full Discussion: Scripting job to complete
Top Forums Shell Programming and Scripting Scripting job to complete Post 302514635 by palanisvr on Sunday 17th of April 2011 05:20:43 AM
Old 04-17-2011
Try this , I have developed the code w.r.t data provided by you .

Code:
#!/bin/ksh

for i in   `grep  -n "-" tempfile.dat |awk -F ':' '{print $1}'`
do
  echo  $i
  idx=`expr $i + 3`
  echo idx : $idx
  echo `sed -n  "$i","$idx"p tempfile.dat|awk  '{print $2}'|tr "\n" " " |awk -F ' ' '{print $1 "|" $2 "|" $3}'` >>newfile.dat
done


Last edited by Franklin52; 04-17-2011 at 11:00 AM.. Reason: Please indent your code and use code tags, thank you
This User Gave Thanks to palanisvr For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

start job after complete transfer....

Hi, I have a situation... I have a script it checks for a file in a folder which comes to the folder every day at specified time...2am to 4 am, once the file is in the polder my process starts...but the problem is the files being placed are huge and it is even taking half an hour for the file... (3 Replies)
Discussion started by: mgirinath
3 Replies

2. Windows & DOS: Issues & Discussions

windows scripting for a batch job

I have been doing unix scripting for quite awhile and there seems to be a wealth of information on it. Now I am working on migrating an intel based application to a new server. I need to modify some existing scripts, but am having trouble finding information on windows scripting, a forum similar... (2 Replies)
Discussion started by: MizzGail
2 Replies

3. UNIX for Advanced & Expert Users

At job in SHELL SCRIPTING

Hi I am using at job in my SHELL scripts.. When it prompts to enter the time for at job..I used to press enter(return) button.. After that its running the job properly, but its showing the below error UX:at: ERROR: Bad date specification.. Can some one suggest how to remove that error. ... (2 Replies)
Discussion started by: grajesh_955
2 Replies

4. Shell Programming and Scripting

How to schedule a job in shell scripting.

Hi all I have made a shell script to check jobs' status and send an alert based on the result. I want to run this script to run every 4 hours and I don't have access to cron. Can we schedule using shell scripting instead of cron facility? (2 Replies)
Discussion started by: johnl
2 Replies

5. Post Here to Contact Site Administrators and Moderators

Where can I download the VTC - Unix Shell Scripting Advanced complete video

Where can I download the VTC - Unix Shell Scripting Advanced complete video. I don't know in which thread I should post this question.Plz help me out, or just tell me the link in the reply to this post. Thanks in advance. (0 Replies)
Discussion started by: villain41
0 Replies

6. Shell Programming and Scripting

Unix Scripting : Sort a Portion of a File and not the complete file

Need to sort a portion of a file in a Alphabetical Order. Example : The user adam is not sorted and the user should get sorted. I don't want the complete file to get sorted. Currently All_users.txt contains the following lines. ############## # ARS USERS ############## mike, Mike... (6 Replies)
Discussion started by: evrurs
6 Replies

7. Windows & DOS: Issues & Discussions

AutoSys Job not waiting for script to complete

I'm not sure if this is the right place to post this issue...but here goes... I am converting a set of windows jobs from Control-M to AutoSys r11.3. The same command line is being executed in both systems. The Control-M job runs to compltion in about 1.5 hours, waiting for the entire batch... (3 Replies)
Discussion started by: ajomarquez
3 Replies

8. Shell Programming and Scripting

I want a script to view the complete log information of data stage job from UNIX IBM AIX.

Hi, I am working on data stage 8.7 version and I want a script a to view the all log information of the data stage job from UNIX environment. Can you please help me out by give the script. Thanks in advance... (7 Replies)
Discussion started by: victory
7 Replies

9. Shell Programming and Scripting

To refire a backup job using shell scripting..........

how to write a code using shell scripting to refire a back up job if it fails with an error code of 196? (7 Replies)
Discussion started by: Pawan Ramnani
7 Replies

10. UNIX for Beginners Questions & Answers

Automation script for email alert when a job get complete with status successful.

Guyz, Please let me know about script which is to be sending an automatic email to particular mail id's when a monotoring job get complete with status successful. (1 Reply)
Discussion started by: Rehan Ahmad
1 Replies
condor_run(1)						      General Commands Manual						     condor_run(1)

Name
       condor_run Submit - a shell command-line as a Condor job

Synopsis
       condor_run [-u universe] "shell command"

Description
       condor_run bundles a shell command line into a Condor job and submits the job. The condor_run command waits for the Condor job to complete,
       writes the job's output to the terminal, and exits with the exit status of the Condor job. No output appears until the job completes.

       Enclose the shell command line in double quote marks, so it may be passed to condor_runwithout modification. condor_runwill not read  input
       from  the  terminal while the job executes. If the shell command line requires input, redirect the input from a file, as illustrated by the
       example

       % condor_run  "myprog < input.data"

       condor_runjobs rely on a shared file system for access to any necessary input files. The current working  directory  of	the  job  must	be
       accessible to the machine within the Condor pool where the job runs.

       Specialized environment variables may be used to specify requirements for the machine where the job may run.

       CONDOR_ARCH

	  Specifies the architecture of the required platform. Values will be the same as the  Arch machine ClassAd attribute.

       CONDOR_OPSYS

	  Specifies the operating system of the required platform. Values will be the same as the  OpSys machine ClassAd attribute.

       CONDOR_REQUIREMENTS

	  Specifies  any additional requirements for the Condor job. It is recommended that the value defined for  CONDOR_REQUIREMENTS be enclosed
	  in parenthesis.

       When one or more of these environment variables is specified, the job is submitted with:

       Requirements = $CONDOR_REQUIREMENTS && Arch == $CONDOR_ARCH && 

	 OpSys == $CONDOR_OPSYS

       Without these environment variables, the job receives the default requirements expression, which requests a machine of the same platform as
       the machine on which condor_runis executed.

       All environment variables set when condor_runis executed will be included in the environment of the Condor job.

       condor_runremoves the Condor job from the queue and deletes its temporary files, if condor_runis killed before the Condor job completes.

Options
       -u universe

	  Submit  the  job  under the specified universe. The default is vanilla. While any universe may be specified, only the vanilla, standard,
	  scheduler, and local universes result in a submit description file that may work properly.

Examples
       condor_runmay be used to compile an executable on a different platform. As an example, first set the environment variables for the required
       platform:

       % setenv CONDOR_ARCH "SUN4u"
       % setenv CONDOR_OPSYS "SOLARIS28"

       Then, use condor_runto submit the compilation as in the following three examples.

       % condor_run  "f77 -O -o myprog myprog.f"

       or

       % condor_run  "make"

       or

       % condor_run  "condor_compile cc -o myprog.condor myprog.c"

Files
       condor_runcreates  the  following  temporary  files in the user's working directory. The placeholder <pid> is replaced by the process id of
       condor_run.

       .condor_run .<pid>

	  A shell script containing the shell command line.

       .condor_submit.<pid>

	  The submit description file for the job.

       .condor_log.<pid>

	  The Condor job's log file; it is monitored by condor_run , to determine when the job exits.

       .condor_out.<pid>

	  The output of the Condor job before it is output to the terminal.

       .condor_error.<pid>

	  Any error messages for the Condor job before they are output to the terminal.

	  condor_run removes these files when the job completes. However, if condor_run fails, it is possible that these files will remain in  the
	  user's working directory, and the Condor job may remain in the queue.

General Remarks
       condor_runis  intended  for  submitting	simple shell command lines to Condor. It does not provide the full functionality of condor_submit.
       Therefore, some condor_submiterrors and system failures may not be handled correctly.

       All processes specified within the single shell command line will be executed on the single machine matched with the job. Condor  will  not
       distribute multiple processes of a command line pipe across multiple machines.

       condor_runwill  use  the  shell	specified  in the  SHELL environment variable, if one exists. Otherwise, it will use /bin/shto execute the
       shell command-line.

       By default, condor_runexpects Perl to be installed in  /usr/bin/perl . If Perl is installed in another path, ask the  Condor  administrator
       to edit the path in the condor_runscript, or explicitly call Perl from the command line:

       % perl path-to-condor/bin/condor_run  "shell-cmd"

Exit Status
       condor_runexits with a status value of 0 (zero) upon complete success. The exit status of condor_runwill be non-zero upon failure. The exit
       status in the case of a single error due to a system call will be the error number ( errno ) of the failed call.

Author
       Condor Team, University of Wisconsin-Madison

Copyright
       Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of  Wisconsin-Madison,  Madison,  WI.  All  Rights  Reserved.
       Licensed under the Apache License, Version 2.0.

       See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu

								  September 2012						     condor_run(1)
All times are GMT -4. The time now is 06:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy