Sponsored Content
Full Discussion: How to write if loop in unix
Top Forums UNIX for Dummies Questions & Answers How to write if loop in unix Post 302128606 by DukeNuke2 on Wednesday 25th of July 2007 04:22:01 PM
Old 07-25-2007
the syntax depends on the shell you are using...

in the korn shell an if statement looks like:

if [ $a = $b]
then
.....
else
.....
fi
 

10 More Discussions You Might Find Interesting

1. Programming

how to write c codes in UNIX

Sorry for asking a very basic question. How do i compile my c codes in UNIX. That is how do i know whether any c compiler is there in my system? If nothing is present where from do i get one and load into my system? (12 Replies)
Discussion started by: rraajjiibb
12 Replies

2. Shell Programming and Scripting

trying to write a script to loop through a port info file

Below is part of a script i have written to loop through part of a port info file. How do i continue the script to get info for OS Device Name, manufacturer and then put information into an array? HBA Port WWN: 10000000c9420b4b OS Device Name: /dev/cfg/c10 Manufacturer: Emulex... (5 Replies)
Discussion started by: rcon1
5 Replies

3. Shell Programming and Scripting

How to write a If loop..

Hi all.. I've written a script which reads all system backup information. #!/bin/ksh export ORACLE_SID=$1 export primaryhost=$2 export sid=`echo $ORACLE_SID| tr ` RESULTFILE=/oracle/PC9/backupstatus_prod.log ssh -l ora${sid} ${primaryhost} "tail -1... (2 Replies)
Discussion started by: suri.tyson
2 Replies

4. Shell Programming and Scripting

Need to write a script to reformat a file in unix but not familiar with unix

unix script must do the fiollowing open a file containing comma delimited records > each record contains 10 fields > removes the 2nd field and use that same field containing fields 2 to 10 the original record after fprocessing should containing fields 1 and 3 a new erecord must be... (10 Replies)
Discussion started by: dwightja
10 Replies

5. Shell Programming and Scripting

Push records to array during implicit loop and write to file

NEWBIE ALERT! Hi, I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
Discussion started by: jospan
0 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. UNIX for Dummies Questions & Answers

Unable to write to a file within a loop

Hi All, Following is the program that i have written in cygwin. The redirection of the unfound $param1 to error.txt file doesnt work.Can any one help? #!/usr/bin/sh fname=$1 sed 's/ //g' "$fname" > fname1 while read i do echo $i > file1 #param1 is script name ... (1 Reply)
Discussion started by: janardhanamk
1 Replies

8. Shell Programming and Scripting

how to write for loop

Hi All, I have one variable "TABLE_LIST" having the values and each valeus i can run in for loop like below: TABLE_LIST= abc,abcd,acbfd i should write the for loop and use each value at a time . Please help me Thanking in advance .............. Regards, Dathu (4 Replies)
Discussion started by: pdathu
4 Replies

9. UNIX for Dummies Questions & Answers

Write a while loop inside for loop?

I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off.... I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Discussion started by: xxhieixx
3 Replies

10. UNIX for Beginners Questions & Answers

How to write a Boolean variable which succeed and failed inside the if loop in shell script ?

I have if loop with multiple variable value check in if loop. How can i print only if loop satisfied variable and its value in shell script ? I dont want to check each variable in if loop. That makes my script larger. if ] then echo "Only satisfied variable with value" ... (3 Replies)
Discussion started by: prince1987
3 Replies
term::ansi::ctrl::unix(n)					 Terminal control					 term::ansi::ctrl::unix(n)

__________________________________________________________________________________________________________________________________________________

NAME
term::ansi::ctrl::unix - Control operations and queries SYNOPSIS
package require Tcl 8.4 package require term::ansi::ctrl::unix ?0.1? ::term::ansi::ctrl::unix::import ?ns? ?arg...? ::term::ansi::ctrl::unix::raw ::term::ansi::ctrl::unix::raw ::term::ansi::ctrl::unix::columns ::term::ansi::ctrl::unix::rows _________________________________________________________________ DESCRIPTION
WARNING: This package is unix-specific and depends on the availability of two unix system commands for terminal control, i.e. stty and tput, both of which have to be found in the $PATH. If any of these two commands is missing the loading of the package will fail. The package provides commands to switch the standard input of the current process between raw and cooked input modes, and to query the size of terminals, i.e. the available number of columns and lines. API
INTROSPECTION ::term::ansi::ctrl::unix::import ?ns? ?arg...? This command imports some or all attribute commands into the namespace ns. This is by default the namespace ctrl. Note that this is relative namespace name, placing the imported command into a child of the current namespace. By default all commands are imported, this can howver be restricted by listing the names of the wanted commands after the namespace argument. OPERATIONS ::term::ansi::ctrl::unix::raw This command switches the standard input of the current process to raw input mode. This means that from then on all characters typed by the user are immediately reported to the application instead of waiting in the OS buffer until the Enter/Return key is received. ::term::ansi::ctrl::unix::raw This command switches the standard input of the current process to cooked input mode. This means that from then on all characters typed by the user are kept in OS buffers for editing until the Enter/Return key is received. ::term::ansi::ctrl::unix::columns This command queries the terminal connected to the standard input for the number of columns available for display. ::term::ansi::ctrl::unix::rows This command queries the terminal connected to the standard input for the number of rows (aka lines) available for display. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
ansi, columns, control, cooked, input mode, lines, raw, rows, terminal COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> term 0.1 term::ansi::ctrl::unix(n)
All times are GMT -4. The time now is 01:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy