No "set" command in bash


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers No "set" command in bash
# 1  
Old 12-13-2010
No "set" command in bash

I am just starting out and learning from "Linux and Unix programming tool, A primer" - Sarwar, Al-Saqabi.
In the first chapter I am required to run the command set then list the settings for the environment variables shown.
When I run set, I get a list of actual code and methods, not a list of env variable terms.
I tried env and I get a list of env variables, but is the the same list as the set command would produce.
I tried man set but there is no manual page for set command.

I am running bash in Ubuntu 10.10 maverick meerkat.

Is my text book out of date, or am I missing the set command somehow?
thanks for any help
# 2  
Old 12-13-2010
Check the information about the shell used in your book. By the looks of it it seems that the book uses (T)CSH instead of ksh/bash, which uses a very different syntax for shell interaction and programming.
# 3  
Old 12-13-2010
Thanks Pludi, the book uses mainly bash, and sometimes tcsh. I have lerant the difference between which shell I'm using, and how to change between those two.
ie echo $SHELL
echo $PATH or (echo $path in tcsh)
whereis bash tcsh

The "set" command is recommended under bash, and the "setenv" command is the comparative tcsh command, according to my book. (So far they give both options to try out under bash/tcsh environments).

Are you saying that bash doesn't have a "set" command?
# 4  
Old 12-13-2010
Just re-read your question, and I have to apologize, a mis-reading on my part.

The set command will not only list the environment variables, but also any shell functions that are available. These include things like auto-complete support, and whatever else Ubuntu deems useful. That's the "code" you're seeing. If you only want the variables, use env instead.
# 5  
Old 12-13-2010
Quote:
I tried man set but there is no manual page for set command.
The set command is described in the man page of bash.
# 6  
Old 12-13-2010
thanks a lot guys
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. Solaris

Netra X1 LOM: Unable to change any variable via the "set" command

I'm posting here as it didn't seem quite right in the hardware section (as it's LOM commands). My apologies if I have that wrong though :) I've finally gotten round to configuring the LOM on my Netra X1, but I can't get it to change the hostname via the "set" command: lom>show hostname... (2 Replies)
Discussion started by: Smiling Dragon
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. AIX

Typing "bash" at the command line spawns two bash processes

Server: IBM p770 OS: AIX 6.1 TL5 SP1 When one of our develoeprs types "bash" on the command line to switch shells, it hangs. For some reason, two bash processes are created....the first bash process spawns a second bash process in the same console, causing a hang. Anyone have any idea what... (2 Replies)
Discussion started by: wjssj
2 Replies

7. Shell Programming and Scripting

Set command ending with a "." (dot)

Hi I have a "set" command which ends with a "." (dot), for example: set `grep "\<${pnum}\>" /tstmp/data.txt |sed 's/#//'` . Can somebody help me to understand the purpose of this "set" and "." combination? The problem is that this command does not produce the same result when run on AIX... (2 Replies)
Discussion started by: aoussenko
2 Replies

8. Programming

Differece between "env" and "set" command

Hi, Please clarify what is the difference between "env" and "set" command. I guess set will display the system variables and user defined variables. Thanks Sweta (1 Reply)
Discussion started by: sweta
1 Replies

9. UNIX for Advanced & Expert Users

Problems with "set pka0_host_id 6" command

I need to change the pka0_host_id 7 to 6 but the command "set pka0_host_id 6" returns "pka0_host_id protected from attempted operation". How can i do that? please i need some answers soon!!!!! thanx (1 Reply)
Discussion started by: Lestat
1 Replies

10. UNIX for Dummies Questions & Answers

Problems with "set pka0_host_id 6" command

I need to change the pka0_host_id 7 to 6 but the command "set pka0_host_id 6" returns "pka0_host_id protected from attempted operation". How can i do that? please i need some answers soon!!!!! thanx (1 Reply)
Discussion started by: Lestat
1 Replies
Login or Register to Ask a Question