Execution of sh file inside vi editor...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Execution of sh file inside vi editor...
# 8  
Old 01-05-2011
Quote:
Originally Posted by methyl
Code:
:! ps

Thanks ...

but it is not displaying the exact .sh file name which is running in backend.So it's difucult to identify.

Please suggest...
# 9  
Old 01-05-2011
Quote:
Originally Posted by meetsubhas
Please suggest...
What about my "fuser" suggestion ? Did you try it ?
# 10  
Old 01-05-2011
Okay, lets show more detail:
Code:
:! ps -f


Ps: Have you considered starting mutiple telnet sessions?
# 11  
Old 01-06-2011
Quote:
Originally Posted by methyl
Okay, lets show more detail:
Code:
:! ps -f

Ps: Have you considered starting mutiple telnet sessions?
Outside the vi we all are using "jobs" for this.

Your code :!ps -f is showing the commands firing at that time which is present inside the sh file but no sh file displaying which is running in backend.

---------- Post updated at 12:15 PM ---------- Previous update was at 12:12 PM ----------

Quote:
Originally Posted by jlliagre
What about my "fuser" suggestion ? Did you try it ?
Hi,

fuser is not available ... So m unable to try it.
# 12  
Old 01-06-2011
Quote:
Originally Posted by meetsubhas
fuser is not available ... So m unable to try it.
It should, although not in the default PATH. Try:
Code:
:!/usr/sbin/fuser nohup.out

or
Code:
:!/etc/fuser nohup.out

# 13  
Old 01-06-2011
Hi,

Thanks .....

Only this output comes :

nohup.out: 1234o 2345o

but still m unable to find out the sh file name.

Need your help...
# 14  
Old 01-06-2011
You question was:
Quote:
How can i see the job is running or not in the backend inside the same vi ?
As long as you have process IDs shown after the nohup.out file, your background job is running.
If you want to double check these processes are the correct ones, you can run:
Code:
:!ptree $(pfiles nohup.out)

at least on HP-UX 11i.
Otherwise, you can use ps with passing the pids (1234 and 2345 in your example) ignore the "o" which means used as output.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execution of loop :Splitting a single file into multiple .dat file

hdr=$(cut -c1 $path$file|head -1)#extract header”H” trl=$(cut -c|path$file|tail -1)#extract trailer “T” SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name If; then # start loop if it is a header While read I #read file Do... (4 Replies)
Discussion started by: SwagatikaP1
4 Replies

2. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

3. UNIX for Dummies Questions & Answers

Ctrl-V + Ctrl-J for newline character does not work inside vi editor

Hi friends, I am trying to add a newline char ('\n') between the query and the commit statement in the following shell script. #! /bin/sh echo "select * from tab; commit;" > data.sql I have tried typing in "Ctrl-V + Ctrl-J" combination which has inserted ^@ (NUL) character but the commit... (1 Reply)
Discussion started by: royalibrahim
1 Replies

4. Shell Programming and Scripting

Parallel execution of command inside file

Hi all, I have the requirement to generate the file containing following command eval /path/ dsjob -logdetail projectname JOBNAME /path/ 1. The file contains the above command say about 150 times i,e only the JOBNAME changes in every command 2. The commands must be written in such a way... (2 Replies)
Discussion started by: sanjay mn
2 Replies

5. Shell Programming and Scripting

Automating execution of commands inside a program

I have a program dnapars I execute the program from command line as following: ./dnapars The program then prompts me some message as a user menu from where I have to select a series of options in the order R U Y R. And then I copy the output file (outfile) in another result file. I wrote the... (3 Replies)
Discussion started by: deeptisjains
3 Replies

6. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

7. Solaris

vi editor garbled file

I am trying to edit a file and when I vi the file, I get rolling lines and garbled messages. So much that I did not want to edit the file for fear of screwing up the file. I am logged in a Sun Box through a Windows Hyperterminal to a SunFire box serial port. I presume that my display is not... (4 Replies)
Discussion started by: bluridge
4 Replies

8. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

9. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

10. Shell Programming and Scripting

how to know whether that file has eol or noeol before opening that file in VI editor

Hi, I want to check whether file has EOL or NOEOL before opening this file in VI editor. My file is very big its in terms of 15-20 MB. I am using ksh for this. When we opened the file in vi editor, normally at last line we are able to see whether this is eol or noeol file. But i does want... (1 Reply)
Discussion started by: HariRaju
1 Replies
Login or Register to Ask a Question