Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Procedural nature of shell scripts Post 302779791 by glev2005 on Wednesday 13th of March 2013 11:14:36 AM
Old 03-13-2013
Procedural nature of shell scripts

Code:
#!/bin/bash
#this is script1
sleep 30

And
Code:
#!/bin/bash
#this is script 2
/path/to/script1.sh
echo im done

Running script 2 will give a 30 second pause and then echo Im done to the terminal. What behavior exactly, is responsible for waiting for script one to complete before the echo line is interpreted? Can someone please explain this mechanism? Does the shell wait for an exit status of any given command unless it is executed with a & at the end to send to background?

Thanks, I hope I am being clear.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

about shell scripts

Hi, i have made a script which makes some analyses on some differnet hosts. but i have a problem to make this script more quicker ... i would like to enter more a one hosts in the query (in my script are this: Pls enter the Hostname ... read hostname for i in $hostname do echo... (5 Replies)
Discussion started by: scottl
5 Replies

2. Shell Programming and Scripting

shell scripts help

Hi, I am not experienced in shell scripts, I hope someone can give some hint for the following problem I have html file like this <html> <body> Some stuff More stuff <pre> A B </pre> Still more stuff And more <pre> C D </pre> Additional stuff </body> (2 Replies)
Discussion started by: ccp
2 Replies

3. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

4. UNIX for Dummies Questions & Answers

Unable to understand associative nature of awk arrays

About associative nature of awk arrays i'm still confused, not able to understand yet how array element can be accessed based on a string, I got one example at gawk manual to illustrate associative nature of awk arrays, it goes here: Codeawk ' # Print list of word frequencies { for (i = 1;... (3 Replies)
Discussion started by: nervous
3 Replies

5. Programming

Specification language suitable for procedural programs

Hello, I'm wondering what methods and tools are used to describe procedural programs? Is UML suitable for such tasks? I've studied SDL in the university - we used it for specification of telecommunication services. Is it suitable for general description of procedural programs? If not what... (2 Replies)
Discussion started by: tsurko
2 Replies

6. UNIX for Dummies Questions & Answers

New to shell scripts

Hi, Probably a real easy one for someone...I need to have a scheduled cp job run from crontab to copy certain files and directories to a shared NFS storage. The script I have works fine, except I need to exclude certain directories to stop issues with symbolic links, can someone explain... (2 Replies)
Discussion started by: paul.duncalf
2 Replies

7. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

8. Solaris

Cant understand the File system working nature

Hi, We have a filesystem whose usage has gone above 81%, i tried to zip some files in the sub directories but the space is not released in the main file system. > df -h Filesystem size used avail capacity Mounted on /u01/app 5.8G 4.6G 1.2G 81% ... (2 Replies)
Discussion started by: nokiak810
2 Replies
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-akq] [-t time] [file [command ...]] DESCRIPTION
The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. If the argument command is given, script will run the specified command with an optional argument vector instead of an interactive shell. The following options are available: -a Append the output to file or typescript, retaining the prior contents. -k Log keys sent to program as well as output. -q Run in quiet mode, omit the start and stop status messages. -t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The default interval is 30 seconds. The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-D (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism). HISTORY
The script command appeared in 3.0BSD. BUGS
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues. When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when in a raw mode where the program being run is doing manual echo. BSD
January 22, 2004 BSD
All times are GMT -4. The time now is 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy