12-02-2012
Thanks for reply Bipin!!!
However this method works only on terminal... any trick to use it in bash script/loop...
I meant, how the script will understand option O and P in for loop/shell script
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I just wonder why the unload tools from INFORMIX doesn't unload all required file to every output of mOutFile at the accumulative way OR my script has an error ? In fact it just unload to one single record at the latest.
for mFile in x???
do
echo "Now working with file "$mFile"... (1 Reply)
Discussion started by: cedrichiu
1 Replies
2. Programming
I'm writing a monitoring application. I'd like to periodically get the information provided by the 'top' command line utility from within my code and write the output of 'top' to a file. Wondering if anyone has already done something like this.
Doing
system("top > someFile");
does not create... (6 Replies)
Discussion started by: antoniomorandi
6 Replies
3. Shell Programming and Scripting
Hi all, I need to write a script "hunt" that is similar to "find" without using "find" in there. Also have to print out how many subdirectories it's got.
like if I type: $hunt unixit will show: 2 /home/var/unix
something like that. I have no idea how to do the file search without using find... (2 Replies)
Discussion started by: sonyd8
2 Replies
4. Shell Programming and Scripting
Hi,
I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh).
The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies
5. UNIX for Dummies Questions & Answers
Hey guys...
I'm learning some shell scripting on OS X using the tcsh shell.
For some reason... my while loop isn't executing right (or more likely I am doing something wrong.)
Something as simple as this doesn't work:
#!/bin/tcsh
set g = 0
while ($g <10)
echo "this" $g
@ g =... (2 Replies)
Discussion started by: sprynmr
2 Replies
6. Shell Programming and Scripting
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies
7. Shell Programming and Scripting
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies
8. UNIX for Beginners Questions & Answers
Hello.
Source file are in : /a/b/c/d/e/f/g/some_file
Destination is : /d/e where sub-directories "f" and "g" may missing or not.
After copying I want /a/b/c/d/e/f/g/file1 in /d/e/f/g/file1
On source /a is top-level directory
On destination /d is top-level directory
I would like... (2 Replies)
Discussion started by: jcdole
2 Replies
SCRIPT(1) BSD General Commands Manual SCRIPT(1)
NAME
script -- make typescript of terminal session
SYNOPSIS
script [-a] [-c COMMAND] [-e] [-f] [-q] [-t] [file]
DESCRIPTION
Script 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.
Options:
-a Append the output to file or typescript, retaining the prior contents.
-c COMMAND
Run the COMMAND rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves
differently when its stdout is not a tty.
-e Return the exit code of the child process. Uses the same format as bash termination on signal termination exit code is 128+n.
-f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can super-
vise real-time what is being done using `cat foo'.
-q Be quiet.
-t Output timing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time
elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used
to replay typescripts with realistic typing and output delays.
The script ends when the forked shell 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. Script works best with commands that do not manipulate
the screen, the results are meant to emulate a hardcopy terminal.
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), scriptreplay(1).
HISTORY
The script command appeared in 3.0BSD.
BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
AVAILABILITY
The script command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
Linux July 30, 2000 Linux