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...
# 1  
Old 01-03-2011
Execution of sh file inside vi editor...

Friends,

Please need your help....

How can i run .sh file inside the vi editor in backend in HP Unix.
# 2  
Old 01-03-2011
You can make use of
Code:
:! sh your_script.sh


ensure that script is having proper permission.

# 3  
Old 01-03-2011
Quote:
Originally Posted by posix
You can make use of
Code:
:! sh your_script.sh


ensure that script is having proper permission.

Thanks ....

If the sh file execution takes more time i.e 30 min then how can i continue work on same vi editor.
So need ur suggestion for run the sh file inside vi for "backend execution".
# 4  
Old 01-03-2011
Code:
:! nohup your_script.sh &

# 5  
Old 01-03-2011
Quote:
Originally Posted by jlliagre
Code:
:! nohup your_script.sh &

Thanks it's working fine...

How can i see the job is running or not in the backend inside the same vi ?

Please suggest..
# 6  
Old 01-03-2011
Code:
:! fuser nohup.out

(assuming fuser is available under HPUX) should show you if the process is still running.

Last edited by jlliagre; 01-04-2011 at 05:15 PM..
# 7  
Old 01-04-2011
Quote:
How can i see the job is running or not in the backend inside the same vi ?
Code:
:! ps

 
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