Sponsored Content
Top Forums Shell Programming and Scripting Script not waiting for user responce Post 302078910 by vgersh99 on Wednesday 5th of July 2006 10:53:59 AM
Old 07-05-2006
Code:
#!/bin/ksh

for dir in $(< dirlsttemp.dat); do

    echo "$dir does not exist, would you like to create it now? (y or n)"
    read responce
    if [ $responce == "y" ]; then
       mkdir $dir
    else
       echo "$dir has not been created"
    fi
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read-waiting for user response

Would there be any reason for why a 'read ans' would not wait for a user's response (i.e user has to hit a key to continue)? I know for sure that it is doing everything else in that part of my 'if' statement but it doesn't wait for me to hit a key before continuing. The strange thing is that... (4 Replies)
Discussion started by: giannicello
4 Replies

2. UNIX for Dummies Questions & Answers

booting up but the system was waiting for user interaction at console

Hi all, My ssytem is mounted on a rack and not connected with any console. When I rebooted it remotely, it didn't go thru the bootup process. when I connect my laptop to the system locally and found that it was waiting for user interaction. Do you know how to disable it, so that it will boot... (1 Reply)
Discussion started by: stancwong
1 Replies

3. Shell Programming and Scripting

Help with script, shutdown if no ping responce

Hi, i would like to create a script that shuts down the system if the power fails, basicly the solaris box would load the script at startup. Ping 192.168.1.100 every 20 secs If cannot get responce 3 times in a row send init 0 to the system. Simple but effective, as 192.168.100.1 wont be on... (39 Replies)
Discussion started by: ringofsteel
39 Replies

4. UNIX for Advanced & Expert Users

Script Not waiting....plz help

Hi All: I am trying to call a multi-step script from a script. here is the code #!/usr/bin/ksh util.sh <<EOF connect dump EOF I am able to run the script but it is disconnecting before the dump job is finished. The script util.sh does not provide any functionality to wait... (9 Replies)
Discussion started by: laxman123
9 Replies

5. Shell Programming and Scripting

expect script hangs while waiting for the flag...

I am writing a script to check whether the root password is set to a special string on some solaris servers. Normally, the manually ssh login session is as below: $ ssh root@host1 Password: Last login: Wed Sep 16 13:53:28 2009 from 10.1.102.13 Sun Microsystems Inc. SunOS 5.10 ... (4 Replies)
Discussion started by: sleepy_11
4 Replies

6. Shell Programming and Scripting

SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script

Dear All, The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script. Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt. Please fins the below sample script which i tried. SCRIPT: -------- #!... (4 Replies)
Discussion started by: little_wonder
4 Replies

7. Shell Programming and Scripting

how to grep the responce on TL1

Hi All, I'm a newbie here.. how can i grep the data when i receive responce from TL1 example: responce from TL1: blabalbalbalbalba.,lbalba,SUCCESFULL,blahblahbalabh... how can i grep the "SUCCESSFULL" while i'm running the script? is it possible? because i'm only to know is if... (2 Replies)
Discussion started by: nikki1200
2 Replies

8. Windows & DOS: Issues & Discussions

AutoSys Job not waiting for script to complete

I'm not sure if this is the right place to post this issue...but here goes... I am converting a set of windows jobs from Control-M to AutoSys r11.3. The same command line is being executed in both systems. The Control-M job runs to compltion in about 1.5 hours, waiting for the entire batch... (3 Replies)
Discussion started by: ajomarquez
3 Replies

9. Shell Programming and Scripting

Waiting for a process to complete in shell script

Hi, I need to initiate a process script which will start and do some processing and then shuts down. Then i need to other verifications. But the the process takes around 25 to 3o minutes. One thing i can monitor the nohup.out file for this process where i can wait for shutting down statement to... (3 Replies)
Discussion started by: Prashanth19
3 Replies

10. Shell Programming and Scripting

Shell read command is not waiting for user input

Hi, i am working on one automation , for that i have writing one shell program that take user input in "while read line" block. but read command is taking value that is readed by While block. while read line; do command 1; command 2 echo -n "Do you want to continute > " read rsp... (2 Replies)
Discussion started by: ranvijaidba
2 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 02:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy