Sponsored Content
Full Discussion: Copy or Move problem
Top Forums Shell Programming and Scripting Copy or Move problem Post 302554121 by sraj142 on Saturday 10th of September 2011 05:52:25 AM
Old 09-10-2011
Hi Cero,

I have tried your advice, but the program is still falling into the while loop while the file is not running... See the following. I guess, the path to my program returned by fuser may causing the problem with the while loop.

108 [shivalpl1] dbadm % fuser /home/dbadm/myprog
/home/dbadm/myprog:

109 [shivalpl1] dbadm % prog
/home/dbadm/myprog:
Still running
/home/dbadm/myprog:
Still running
/home/dbadm/myprog:
^C

Regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to copy/move folder on XP to Solaris?

I have created a folder on C:\images\Raffles.jpg on my PC, and I like to copy or move to Solaris server. How can I do that? Please advise. Thanks in advance. (2 Replies)
Discussion started by: simt
2 Replies

2. Shell Programming and Scripting

Help with Copy Move Script

Hello Gurus! Please help! I would like to get some help with the following: I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies

3. Shell Programming and Scripting

ncftp copy/move pb

Hi, i have made this script for copy file in folder FTP in my local machine, when copy is finish i move files copied in backups_001 directory on same ftp 1°) the problem is if this script works with date if date is similar i taken, but if one day in ftp they put new file is no getting ... (0 Replies)
Discussion started by: livetele
0 Replies

4. Shell Programming and Scripting

Bash Copy-Move file problem

Hello, I made a script to copy files from one directory to another and move file after the copy is done. When files are present in the source directory there is no problem but when no file are present I'm getting an error. Please help !! --------------------- #!/bin/bash ... (2 Replies)
Discussion started by: lsimoneau
2 Replies

5. UNIX for Dummies Questions & Answers

How to copy/move to a file with a special character as the 1st char in the filename?

I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell. I am able to create files with special characters in the filenames...e.g. cp -pv foo.gif \*special.gif cp -pv foo.gif \... (6 Replies)
Discussion started by: sqa777
6 Replies

6. UNIX for Dummies Questions & Answers

help pls! need to move and copy pattern...

Help please... Need to convert below: Subcase ID : 10001 210000 0 1.22049E+01 220000 0 6.29560E+00 Subcase ID : 20703 210000 0 2.76398E+00 220000 0 2.43183E+00 230000 0 -1.87728E+01 Subcase ID : 13703 210000 0 ... (2 Replies)
Discussion started by: lakanino
2 Replies

7. UNIX for Dummies Questions & Answers

Unable to copy or move file

I am trying to move a file that is in the root directory. I suspect it is an old file created by someone when the system was installed. I am testing accessing the file by doing a copy but the command does not find the file. I am operating as root. We are HP-UX B.11.23 I do long listing and... (3 Replies)
Discussion started by: phcorn
3 Replies

8. Shell Programming and Scripting

Copy/move file which are not currently in use.

Hello experts, I'm doing a shell script that able to copy or move files. My situation is i have a drive ( lets say its S drive) where its receive all the files from mainframe i need to copy all the file from S drive to T drive. but only those files that are finished copied from mainframe... (5 Replies)
Discussion started by: CelvinSaran
5 Replies

9. Solaris

Can't erase/move/copy file!

Hey everyone!. I have a problem with a file that doesn't allow any operation on it. I can't rm,mv,cp nor any other operation to it, I get the following errors: bash-2.05# mv ora_2527.aud /bkp mv: cannot access ora_2527.aud bash-2.05# cp ora_2527.aud /bkp cp: cannot access ora_2527.aud... (4 Replies)
Discussion started by: dragonov7
4 Replies

10. Red Hat

Separate the apache user file and move or copy some were

Hi all, I'm Using Centos 6.4 /opt/my_aplication/entry/data/0/ There are Thousands of files in this Directory, Only i need to copy or move the apache User's file from this to /tmp/backup , I have listed apache user's file using find . -user apache -type f , its gave me the only apache... (2 Replies)
Discussion started by: babinlonston
2 Replies
prof(1) 						      General Commands Manual							   prof(1)

Name
       prof - analyze profile data

Syntax
       prof [ options ] [ prog_name ] [ pcsampling_data_file ...  ]
       prof -pixie [ -note comment_string ] [ options ] [ prog_name [ bbaddrs_file [ bbcounts_file ...	] ] ]

Description
       The  command  analyzes  one or more data files generated by the compiler's execution-profiling system and produces a listing. Prof can also
       combine those data files or produce a feedback file that lets the optimizer take into account the program's runtime behavior during a  sub-
       sequent compilation.  Profiling is a three-step process: first compile the program, then execute it, and finally run to analyze the data.

       The compiler system provides two kinds of profiling:

	    1.	   pc-sampling interrupts the program periodically, recording the value of the program counter.

	    2.	   basic-block counting divides the program into blocks delimited by labels, jump instructions, and branch instructions. It counts
		   the number of times each block executes. This provides more detailed (line by line) information than pc-sampling.

Using Pc-sampling
       To use pc-sampling, compile your program with the option -p (strictly speaking, it is sufficient to use this option only when  linking  the
       program.)  Then	run  the  program, which allocates extra memory to hold the profile data, and (provided the program terminates normally or
       calls records the data in a file at the end of execution.

       The environment variable PROFDIR determines the name of the pc-sampling data file and determines whether pc-sampling takes place:  if it is
       not  set,  the  pc-sampling data file is named mon.out ; if it is set to the empty string, no profiling occurs; if it is set to a non-empty
       string, the file is named string/pid.progname, where pid is the process id of the executing program and progname is the program's name,	as
       it appears in argv[0]. The subdirectory string must already exist.

       After running your program, use to analyze the pc-sampling data file.

       For example:

	    cc -c myprog.c
	    cc -p -o myprog myprog.o
	    myprog		     (generates "mon.out")
	    prof myprog mon.out

       When  you  use  for pc-sampling, the program name defaults to a.out and the pc-sampling data file name defaults to mon.out ; if you specify
       more than one pc-sampling data file, reports the sum of the data.

Using Basic-block Counting
       To use basic-block counting, compile your program without the option -p .  Use to translate your program into a profiling version and  gen-
       erate a file, whose name ends in .Addrs, containing block addresses. Then run the profiling version, which (assuming the program terminates
       normally or calls will generate a file, whose name ends in .Counts, containing block counts.  Then use with the -pixie  option  to  analyze
       the bbaddrs and bbcounts files. Notice that you must tell the name of your original program, not the name of the profiling version.

       For example:

	    cc -c myprog.c
	    cc -o myprog myprog.o
	    pixie -o myprog.pixie myprog       (generates "myprog.Addrs")
	    myprog.pixie		  (generates "myprog.Counts")
	    prof -pixie myprog myprog.Addrs myprog.Counts

       When  you  use  with  the -pixie option, the program name defaults to a.out , the bbaddrs file name defaults to program_name.Addrs, and the
       bbcounts file name defaults to program_name.Counts. If you specify more than one bbcounts file (never specify more than one bbaddrs  file),
       reports	the  sum of the data.  -note comment_string If you use this argument, the comment_string appears near the beginning of the listing
       as a comment.

       Provided you do not use -pixie, processes mon.out files produced by earlier versions of the compiler system using the obsolete -p2  or  -p3
       options.

Options
       For  each  option,  you	need  type only enough of the name to distinguish it from the other options (usually the first character is suffi-
       cient).	Unless otherwise noted, each part of the listing operates only on the set of procedures that results from the combination  of  the
       -exclude and -only options.

       If the options you specify would neither produce a listing nor generate a file, uses -procedures plus -heavy by default.

       -pixie	 Selects pixie mode, as opposed to pc-sampling mode.

       -procedures
		 Reports  time	spent  per  procedure (using data obtained from pc-sampling or basic-block counting; the listing tells which one).
		 For basic-block counting, this option also reports the number of invocations per procedure.

       -heavy	 Reports the most heavily used lines in descending order of use (requires basic-block counting).

       -lines	 Like -heavy , but gives the lines in order of occurrence.

       -invocations
		 For each procedure, reports how many times the procedure was invoked from each of  its  possible  callers  (requires  basic-block
		 counting).  For this listing, the -exclude and -only options apply to callees, but not to callers.

       -zero	 Prints a list of procedures that were never invoked (requires basic-block counting).

       -testcoverage
		 Reports all lines that never executed (requires basic-block counting).

       -feedback filename
		 Produces  a  file  with  information  that the compiler system can use to decide what parts of the program will benefit most from
		 global optimization and what parts will benefit most from in-line procedure substitution (requires basic-block counting). See

       -merge filename
		 Sums the pc-sampling data files (or, in pixie mode, the bbcounts files) and writes the result into a new file with the  specified
		 name. The -only and -exclude options have no effect on the merged data.

       -only procedure_name
		 If  you use one or more -only options, the profile listing includes only the named procedures, rather than the entire program. If
		 any option uses an uppercase O for Only, uses only the named procedures, rather than the entire program, as the base  upon  which
		 it calculates percentages.

       -exclude procedure_name
		 If  you use one or more -exclude options, the profiler omits the specified procedure and its descendents from the listing. If any
		 option uses an uppercase E for Exclude, also omits that procedure from the base upon which it calculates percentages.

       -clock megahertz
		 Alters the appropriate parts of the listing to reflect the clock speed of the CPU. If you do not specify megahertz,  it  defaults
		 to 8.0.

       -quit n	 Truncates  the  -procedures  and  -heavy listings. It can truncate after n lines (if n is an integer), after the first entry that
		 represents less than n percent of the total (if n is followed immediately by a percent character (%)), or  after  enough  entries
		 have been printed to account for n percent of the total (if n is followed immediately by cum%).  For example:
		 -quit 15
		 truncates each part of the listing after 15 lines of text.
		 -quit 15%
		 truncates each part after the first line that represents less than 15 percent of the whole.
		 -quit 15cum%
		 truncates each part after the line that brought the cumulative percentage above 15 percent.

Restrictions
       The command does not yet take into account interactions among floating-point instructions.

Files
       crt0.o	    normal startup code
       mcrt0.o	    startup code for pc-sampling
       libprof1.a   library for pc-sampling
       mon.out	    default pc-sampling data file

See Also
       as(1), cc(1), pixie(1), profil(2), monitor(3)
       Guide to Languages and Programming

								       RISC								   prof(1)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy