07-21-2008
set command
Hi,
I am new to unix and trying to learn shell scripting. I am using Redhat linux instead of unix and using Bash shell.
I typed some code which consist of "set" command. I got the code from a book.
The code is,
set 'who am i'
echo $name
Actually the output should be my logname. But it displays as "who".
Can anyone help me?
Regards
S.Saravanakumar
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Unixers, :)
In a shell script i found the following statements
mline='grep\^ 1111 emaster.dbf
set -- $mline
The first statement searches the emaster.dbf file for the code 1111 and ifit finds any such line it gets that line and stores it in mline.
But iam getting little bit confusion with... (4 Replies)
Discussion started by: ravi raj kumar
4 Replies
2. Shell Programming and Scripting
Hello
I'm using command "set" to count number of word in file .
But I don't know how to get number of lines in file using commnad "set " ?.
Please Help.
#!/bin/sh
set -- `cat $1`
echo " $# words " # wc -w $1 (4 Replies)
Discussion started by: scotty_123
4 Replies
3. Shell Programming and Scripting
i have a script in which i go to a particular dir and list all its file
------------------------------------------------------------------------
#!/bin/ksh
if test -d systemProperties
then
set --`cd systemProperties`
for i in *
do
echo "$i" >> lastm2.txt
done
fi... (2 Replies)
Discussion started by: ali560045
2 Replies
4. UNIX for Dummies Questions & Answers
I have heard the following command and seen people using it at shell but I don't know what it is for and when it is used. I will appreciate any comment regarding the use of this command.
set -o vi (2 Replies)
Discussion started by: agasamapetilon
2 Replies
5. Shell Programming and Scripting
hi all,
Please tell all the uses of set -x command.
Also can you tell about other options which can be used with set command.
Thanks:)
sumit (3 Replies)
Discussion started by: sumit207
3 Replies
6. Shell Programming and Scripting
Hi,
I have following scenario..
set -e
eval Command 1
eval Command 2
eval Command 3
gmake realclean
but now the problem is I want to print an error message, advising user to run gmake realclean after resolving errors if any of the Command1/2/3 failed. I know I can use trap to do... (0 Replies)
Discussion started by: Shribigb
0 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
Some clarification regarding the unix set command for ksh env.
I read up the man pages, but ended up more blur. Eg.
- Turns off -x and -v flags and stops examining argu-
ments for flags.
- Does not change any of the flags. This option is
... (1 Reply)
Discussion started by: srage
1 Replies
8. HP-UX
Hi,
I am using hp unix
i want to know the use of the following commands
set --
set - variable
thanks (4 Replies)
Discussion started by: gomathi
4 Replies
9. UNIX for Dummies Questions & Answers
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Discussion started by: Straitsfan
5 Replies
10. UNIX for Dummies Questions & Answers
Hi Guys,
I like to output every command executed in the script to a file.
I have tried set -x which does the same.
But it is not giving the logs of the child script which is being called from my script.
Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies
LEARN ABOUT SUSE
ansi_ctrlu
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)