10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've always written scripts where the user executes the script and I prompt them for what they want to do.
But I'm trying to write a script where root executes the script 'lock' or its hard-link 'unlock' and the script will passwd -l or passwd -u an account depending on the choice.
What would... (3 Replies)
Discussion started by: ADay2Long
2. Shell Programming and Scripting
I am currently trying to develop a script to connect to mulltiple servers, reading specifc data from log files on the servers and append the data from each file into a single tab delimited row. So, at the end I am planning to have a report with all the extracted data with each row per server. I am... (5 Replies)
Discussion started by: scriptingnewbie
3. Shell Programming and Scripting
This is one of the strangest things that's happening to me.
I'm writing a new Perl script that is trying to read a file.
The file is originally in .mof format, but I also saved the contents into a .txt file.
As a simple test, I wrote this:
... (3 Replies)
Discussion started by: kooshi
4. Shell Programming and Scripting
Alright, so the goal of my script is to read text from standard input and store it into a file using the ex-editor:
so far i've got this, but it doesn't work.
ex $1 >> HERE
I don't get any errors either, so i don't know what i'm doing wrong. (7 Replies)
Discussion started by: Bertieboy7
5. Shell Programming and Scripting
Can I do something like,
for an input like: int a=5;
If the syntax is right, it is not working for me, but I am not sure about the syntax. Please help.
Prasanna (1 Reply)
Discussion started by: prasanna1157
6. Shell Programming and Scripting
I need to know how the the string constant from Input File should be read and provide as input data for the script .
urname=/root/dir/syslog/urname1... (6 Replies)
Discussion started by: baraghun
7. Shell Programming and Scripting
I've written up a script, that populates a variable with a list of tapes returned from my library. For example:
So now, the variable "TAPELIST" contains those numbers, delimited by commas. I'd like to... (6 Replies)
Discussion started by: Stephan
8. Shell Programming and Scripting
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a... (2 Replies)
Discussion started by: bhargavkr
9. Shell Programming and Scripting
while read line
I am trying to read the contents of this file line by line and perform a routine for each line read.
The file contents are numbers..
What is wrong with my... (1 Reply)
Discussion started by: gzs553
10. UNIX for Dummies Questions & Answers
echo "Enter reason:"
echo "> \c"
$reason >> access.log
This doesnt work for me. Can someone tell me how I would read the input from what the person types, and then append that to the log file?
Regards (2 Replies)
Discussion started by: alwayslearningunix
SCRIPT(1) BSD General Commands Manual SCRIPT(1)
script -- make typescript of terminal session
script [-a] [-k] [-q] [-t time] [file [command ...]]
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.
-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.
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).
csh(1) (for the history mechanism).
The script command appeared in 3.0BSD.
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.
June 6, 1993 BSD