Runnin Sequential commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Runnin Sequential commands
# 1  
Old 06-04-2007
Data Runnin Sequential commands

I hav 2 execute the following commmands in bash shell sequentially

i can execute the following commands ie
#mkdir /export/zone1 /export/zone1
#chmod 700 /export/zone1

#zonnefg -z zone1 this command has to change the propmpt as
#zonecfg:zone1>
only wen the prompt changes to #zonecfg:zone1> i can execute CREATE cmd.

im not able 2 execute this shell script!!!!
can u plzzz help us?
# 2  
Old 06-04-2007
Why don't you try using here-docs? Something like this might work:
Code:
zonecfg -z zone1 <<EOF
create
set zonepath=/zone1
...
...
EOF

# 3  
Old 06-04-2007
mkdir /export/zone3
chhm0d 700 /export/zone3
zonecfg -z zone3 <<EOF
create
set zonepath=/export/zone3
set autoboot=true
add net
set physical=bge0
set address=172.1.2.86
end
verify
commit
exit
EOF
zonedam -z zone3 install

i tried using this but it just creating the path and its directory nothin s being performed!!! wat 2 do? after zonecfg:zone3> the prompt has 2 change into zonecfg:zone3:net > after executin add net cmd! but in vain nothin s being performed from the shell script
# 4  
Old 06-04-2007
sequential commands in shell

mkdir /export/zone3
chhm0d 700 /export/zone3
zonecfg -z zone3 <<EOF
create
set zonepath=/export/zone3
set autoboot=true
add net
set physical=bge0
set address=172.1.2.86
end
verify
commit
exit
EOF
zonedam -z zone3 install

i tried using this but it just creating the path and its directory nothin s being performed!!! wat 2 do? after zonecfg:zone3> the prompt has 2 change into zonecfg:zone3:net > after executin add net cmd! but in vain nothin s being performed from the shell script
Edit/Delete Message
# 5  
Old 06-04-2007
First of all, follow the rules. No duplicate posts. Secondly, have you looked at the -f option of zonecfg? It allows putting all commands that you want to run in one file which is read and executed line by line. Read the man page to see how you can use this.
# 6  
Old 06-05-2007
Sequential commands

sorry for abiding rules!
sir i tried the -f option but in vain tat s not happenin!
i need to execute these set of cmds wen i click on the create button!
its only creating a blank directory but! its not executing the sub cmds which is inside the zonecfg resource? how 2 do? plz help...... Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for sequential pattern

input file: 4 5 1 A 1 2 3 4 s 8 (input file can be many millions of lines long) I want to search the example input file above, and when I find 4 sequential rows with values of 1,2,3,4 return those values and the two previous ones. In this case it should return 1,A,1,2,3,4 I know... (8 Replies)
Discussion started by: cedenker
8 Replies

2. Shell Programming and Scripting

Extracting sequential pattern

Hi, Can someone advise/help me on how to write a script to extract sequential lines. I was able to find and get a script working to create permutations of the inputs, but that not what I want/need. awk 'function perm(p,s, i) { for(i=1;i<=n;i++) if(p==1) ... (4 Replies)
Discussion started by: fuzzi
4 Replies

3. Shell Programming and Scripting

Sequential numbering from 1 to ten

Hi I am in a bind, I need create a script that will rename files as they come into a folder with sequential numbering at the begining starting at 1 and proceeding to ten then starting at 1 again. Such as 1_filename.pdf, 2_filename.pdf, 3_filename.pdf, 4_filename.pdf, 5_filename.pdf, 6_filename.pdf,... (6 Replies)
Discussion started by: Paul Walker
6 Replies

4. Shell Programming and Scripting

Sequential execution of commands in ksh

I need to run few commands in a ksh script sequentially. Some of the commands are jobs submitted to the server and the consecutive commands are dependent on the completion of the jobs submitted to the server. It works if i separate the commands into different files like this #!/bin/ksh... (1 Reply)
Discussion started by: prashob123
1 Replies

5. Shell Programming and Scripting

Sequential counting

Hi have a file of the following format a1 a1 a2 a2 a4 a4 a4 a3 a3 a5 a6 a6 a6 a6 .. 100's of lines (2 Replies)
Discussion started by: Lucky Ali
2 Replies

6. Shell Programming and Scripting

Sequential numbers

Hi All, I am looking for a simple way to write numbers to a file sequentially starting from 1 and ending on a specified upper limit. Example of the output file is below Example 1 2 3 4 5 . . . . 1000 please let me know the best way to do it. (10 Replies)
Discussion started by: Lucky Ali
10 Replies

7. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

8. Shell Programming and Scripting

sequential to line sequential

Hi I have a file sequential way i.e. written in contineous mode and the Record Seperator is AM from which the record is seperated .Now to process I have to make line sequential,and more over record length is not same it varies as per the input address, AM1234563 John Murray 24 Old streeet old... (5 Replies)
Discussion started by: vakharia Mahesh
5 Replies

9. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

10. Shell Programming and Scripting

running script sequential

I have 4 scripts I need to run sequentially(can't run simultaneously) What's the syntax for it? I am running Korn Shell. Thanks, (2 Replies)
Discussion started by: ocjunky
2 Replies
Login or Register to Ask a Question