Finding PID of a process using variable substituition
Hi All,
Am copying mulitple files in a directory in names File0,File1,File2 etc.
I need to print separately the PID of these copies using File names.
It printed nothing. Thinking "File$i" is not found. Am i right? Is there a way to find the PID of a process using variable substituition? If not, how it cud be achieved?
FYI,I got the PID of FIle0 or FIle1 if i use its name specifically like,
Can some one please tell me how to find out the proccess ID that is holding up a file.
I am attempting to remove a file and I am getting a message stating that it is busy.
i.e
rm filename
filename: 777 mode ? (y/n) y
rm: filename not removed. Text file busy
Thanks in advance. (1 Reply)
hi all,
Is there a simple script anyone could through out to me, to find the pid of a process given the name. I actually need to bind this pid to a processor set. I would probably put these comamns in a shell script which would have.
a) kick start the executable
b) get the pid
c) bind it to a... (10 Replies)
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Hi
I have written a shell script to find and kill the particular process. Here in shell script i have written the code like
cnt = $(ps -ef | grep Shree)
echo $cnt
I am getting the output
root 2326 2317 0 14:39:46 pts/1 0:28 Shree -f fdc.fbconf FDCapp.fbapp
Here I want to... (2 Replies)
Hi, is there a command that takes the PID of a process and that only diplays it's ni number?
I`m pretty sure it would require pipes but I tried a few things that ended up miserably...
Since the ps command doesn't show the ni unless I do ps -o ni but then I can't find a way to search the right... (2 Replies)
Say I have 2 processes(perl scripts on Solaris machine) A and B.
the process A kill the process B.
While in the process B how do I print the PID of the process that Killed it(process A) before dieing.
My process A looks like
open(STATS, "ps -ef|");
while ($inputLine = <STATS>) {
if... (7 Replies)
Hi All,
I need to get the PID of a process which i ran in background into a variable
echo $! gives me the PID of last background process but how to get this into a variable so that i can use "wait" command later in the script to make sure that this background process was done
var = `echo... (5 Replies)
The end result that I'd like is to terminate any process on my ps -u username list that extends beyond 20 minutes. I know for a fact that this process will be named l.exe, but I don't know the number in between and I won't know the PID. Is there a way to use grep or pidof to do this task every 20... (2 Replies)
Hello All,
I am facing difficulty in getting the PID value & then assigning it to a variable,
kindly help me in resolving the issue.
Thanks a lot in advance.
The custom utility used inside the Test2.sh will process the file in a batch of 10 lines at once and for efficient memory management,... (3 Replies)
Hello All,
I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command.
1.The fifty scripts are stored in a separate file.
2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies
LEARN ABOUT BSD
cp
CP(1) General Commands Manual CP(1)NAME
cp - copy
SYNOPSIS
cp [ -ip ] file1 file2
cp [ -ipr ] file ... directory
DESCRIPTION
File1 is copied onto file2. By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source
file modified by the current umask(2) is used. The -p option causes cp to attempt to preserve (duplicate) in its copies the modification
times and modes of the source files, ignoring the present umask.
In the second form, one or more files are copied into the directory with their original file-names.
Cp refuses to copy a file onto itself.
If the -i option is specified, cp will prompt the user with the name of the file whenever the copy will cause an old file to be overwrit-
ten. An answer of 'y' will cause cp to continue. Any other answer will prevent it from overwriting the file.
If the -r option is specified and any of the source files are directories, cp copies each subtree rooted at that name; in this case the
destination must be a directory.
SEE ALSO cat(1), mv(1), rcp(1C)4th Berkeley Distribution June 8, 1985 CP(1)