Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

typeset command, what it does ?

29 views
Skip to first unread message

PM Wong

unread,
Apr 13, 1994, 12:25:20 AM4/13/94
to
Recently I got a shell script from USENET. It contains a command as:
typeset -lL3 pusr=$usr

I wonder if it is a standard UNIX text-formatting command. I could not
find it on our UNIX system (AIX) by doing a man
Could someone tell me what the command above actually does, so I
can consider replacing with some similar commands.
--

\\\//
(o o)
[----------------ooO-(_)-Ooo---------------] PM Wong (Computer Officer)
[User User User User User User User User Us] CTSC Hong Kong Baptist College
[ser User User User User User User User Use] 224 Waterloo Road, Kln. HONGKONG
[er User User User User User User User User] Voice: (852)3397425 Fax: 3397888
[------------------------------------------] Email: p...@ctsc.hkbc.hk

Ami Fischman

unread,
Apr 13, 1994, 12:35:53 PM4/13/94
to
PM Wong (s11...@ctsc.hkbc.hk) wrote:
: Recently I got a shell script from USENET. It contains a command as:
: typeset -lL3 pusr=$usr

: I wonder if it is a standard UNIX text-formatting command. I could not
: find it on our UNIX system (AIX) by doing a man
: Could someone tell me what the command above actually does, so I
: can consider replacing with some similar commands.

I'm not sure, but I think that's a shell built in command. Check the man
page for your shell, and grep it for typeset.

--
--Ami
Have YOU hugged YOUR smurf today?
That secret you've been guarding, isn't.

Frank J. Edwards

unread,
Apr 13, 1994, 1:24:06 PM4/13/94
to
s11...@ctsc.hkbc.hk (PM Wong) sayeth:

>Recently I got a shell script from USENET. It contains a command as:
> typeset -lL3 pusr=$usr
>
>I wonder if it is a standard UNIX text-formatting command. I could not
>find it on our UNIX system (AIX) by doing a man
>Could someone tell me what the command above actually does, so I
>can consider replacing with some similar commands.

It is a Korn shell built-in command. It creates a variable called
"pusr" as a lowercase, left-justified string limited to 3 characters.

>[----------------ooO-(_)-Ooo---------------] PM Wong (Computer Officer)

>[------------------------------------------] Email: p...@ctsc.hkbc.hk
--
Frank "Crash" Edwards Edwards & Edwards Consulting
Voice: 813/786-3675 Unix/AIX & OS/2: Training, Programming, and SysAdmin
Data/Fax: 813/787-3675 cr...@azhrei.EEC.COM; inquiries to in...@azhrei.EEC.COM

Mike Kail

unread,
Apr 13, 1994, 7:57:45 AM4/13/94
to
In article <2ofs7g$16...@ctsc.hkbc.hk>, s11...@ctsc.hkbc.hk (PM Wong) writes:
|> Recently I got a shell script from USENET. It contains a command as:
|> typeset -lL3 pusr=$usr
|>
|> I wonder if it is a standard UNIX text-formatting command. I could not
|> find it on our UNIX system (AIX) by doing a man
|> Could someone tell me what the command above actually does, so I
|> can consider replacing with some similar commands.
|> --
|>
This is a Korn-Shell command. The -l converts uppercase to lowercase and
the -L3 defines variables as "flush-left strings, n chars long", where in this
case n == 3.

|> \\\//
|> (o o)
|> [----------------ooO-(_)-Ooo---------------] PM Wong (Computer Officer)
|> [User User User User User User User User Us] CTSC Hong Kong Baptist College
|> [ser User User User User User User User Use] 224 Waterloo Road, Kln. HONGKONG
|> [er User User User User User User User User] Voice: (852)3397425 Fax: 3397888
|> [------------------------------------------] Email: p...@ctsc.hkbc.hk
|>

--
+---------------------------------------------------------------+
| Mike D. Kail AT&T: (612) 945-8044 |
| ProviderLink Developer FAX: (612) 945-8430 |
| United HealthCare Corp. E-Mail: mk...@uhc.com |
+---------------------------------------------------------------+
| "Nothing great was ever achieved without enthusiasm." |
| - Ralph Waldo Emerson |
+---------------------------------------------------------------+

David M Williams

unread,
Apr 13, 1994, 9:23:51 PM4/13/94
to
s11...@ctsc.hkbc.hk (PM Wong) writes:

>Recently I got a shell script from USENET. It contains a command as:
> typeset -lL3 pusr=$usr

>I wonder if it is a standard UNIX text-formatting command. I could not
>find it on our UNIX system (AIX) by doing a man
>Could someone tell me what the command above actually does, so I
>can consider replacing with some similar commands.

The command typeset is a command internal to the BASH shell (perhaps some
other shells, also). It is not a text formatting command, but rather sets
environment variables. In this case, the variable 'puser' will be set equal
to the contents of the variable 'usr', with the -lL3 being some sort of
modifier. I am not just how it will modify the variable, perhaps doing a man
on the shell that the program was written for will elaborate.

I hope that this has been of some help,
David Williams

--
.////. .// David M. Williams da...@cs.newcastle.edu.au
o:::::::::/// Department of Computer Science, University of Newcastle
>::::::::::\\\ " Amazing love! How could it be
'\\\\\' \\ that thou oh God shouldst die for me!"

Leonid Volnitsky

unread,
Apr 19, 1994, 2:47:11 PM4/19/94
to
David M Williams (da...@sage.newcastle.edu.au) wrote:
> s11...@ctsc.hkbc.hk (PM Wong) writes:

> >Recently I got a shell script from USENET. It contains a command as:
> > typeset -lL3 pusr=$usr

> >Could someone tell me what the command above actually does, so I


> >can consider replacing with some similar commands.

> The command typeset is a command internal to the BASH shell (perhaps some
> other shells, also).


to the POSIX like SH. In this case it is ksh.
-l - all upper case characters converted to lower case
-L3 - left justify and remove leading blacks from value, 3 - field width


--
Seeking job: UNIX/MSDOS/WAN/LAN SysAdmin, SW engineer

0 new messages