New z-shell user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New z-shell user
# 1  
Old 01-15-2004
New z-shell user

Hi,

I've just downloaded the following files and have been tinkering with using zsh on my NT box.

Z-shell executable:

ftp://ftp.blarg.net/users/amol/zsh/zsh.exe.gz

Unix Utilities:

http://homepage.mac.com/shadowboxer/unxutils.exe

First impressions are good but I have 2 questions. Firstly, where can I get some installable man pages? Secondly, why can't I seem to get 'here documents' working correctly.

In the following example the 'heredoc' doesn't pick up the closing string, '!!'.

ZSH$ cat << !!
heredoc> hello world
heredoc> !!
heredoc>

And in this example, I have no idea what is happening. I can confirm that cat <filename> would work however.

ZSH$ cat << EOF
heredoc> hello world
heredoc> EOF
zsh: permission denied
ZSH$

Any ideas?

Damian
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Switch from Local user to root user from a shell script?

Hi, I need to switch from local user to root user in a shell script. I need to make it automated so that it doesn't prompt for the root password. I heard the su command will do that work but it prompt for the password. and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies

2. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

3. Shell Programming and Scripting

Best way to run a shell with different user

Hi , we got autosys for scheduling our jobs. Autosys user logs in to the Linux box and need to execute a shell script. problem here is user requires admin privileges on database to complete the task. Since scheduling is maintained by different team I don't want autosys user to have admin privileges... (1 Reply)
Discussion started by: rush143
1 Replies

4. UNIX for Advanced & Expert Users

Configuring user in c-shell

Hi, We need to configure user in c shell with the following format when he tries to login to the system for SOLARIS 9 OS username@hostname> Let me know the steps for the confiuring the user login as per the requirement.. (2 Replies)
Discussion started by: hydoss1
2 Replies

5. Shell Programming and Scripting

How to Login as another user through Shell script from current user[Not Root]

Hi Every body, I would need a shell script program to login as different user and perform some copy commands in the script. example: Supppose ora_toms is the active user ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands ... (9 Replies)
Discussion started by: ujjwal27
9 Replies

6. UNIX for Dummies Questions & Answers

default shell for the user

for example, if we specify,#!/usr/bin/ksh then the script will be executed in korn shell. If we don't specify that line, the script will be executed using the default shell. So, how we can identify the default shell for the current user? Will it be in .profile file ? Thanks (13 Replies)
Discussion started by: pandeesh
13 Replies

7. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

8. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

9. UNIX for Dummies Questions & Answers

change user in a shell

Hi, is it possible to chnage the user in a shell script? i would like to create a script with should make some actions on the host which needs root permissions. i want do give the user which should start the script the root permissions. so is it possible to make a command in the script... (2 Replies)
Discussion started by: scottl
2 Replies

10. UNIX for Dummies Questions & Answers

User Shell script

I'm very new at this -- HELP! I need to know how to terminate a users session when they exit a shell script menu? Any ideas would be much appreciated! Holli (2 Replies)
Discussion started by: HOlli
2 Replies
Login or Register to Ask a Question
ZSH(1)							      General Commands Manual							    ZSH(1)

NAME
zsh - the Z shell OVERVIEW
Because zsh contains many features, the zsh manual has been split into a number of sections: zsh Zsh overview (this section) zsh-betaroadmap Informal introduction to the manual zsh-betamisc Anything not fitting into the other sections zsh-betaexpn Zsh command and parameter expansion zsh-betaparam Zsh parameters zsh-betaoptions Zsh options zsh-betabuiltins Zsh built-in functions zsh-betazle Zsh command line editing zsh-betacompwid Zsh completion widgets zsh-betacompsys Zsh completion system zsh-betacompctl Zsh completion control zsh-betamodules Zsh loadable modules zsh-betacalsys Zsh built-in calendar functions zsh-betatcpsys Zsh built-in TCP functions zsh-betazftpsys Zsh built-in FTP client zsh-betacontrib Additional zsh functions and utilities zsh-betaall Meta-man page containing all of the above DESCRIPTION
Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles ksh but includes many enhancements. Zsh has command line editing, builtin spelling correction, program- mable command completion, shell functions (with autoloading), a history mechanism, and a host of other features. AUTHOR
Zsh was originally written by Paul Falstad <pf@zsh.org>. Zsh is now maintained by the members of the zsh-workers mailing list <zsh-work- ers@zsh.org>. The development is currently coordinated by Peter Stephenson <pws@zsh.org>. The coordinator can be contacted at <coordina- tor@zsh.org>, but matters relating to the code should generally go to the mailing list. AVAILABILITY
Zsh is available from the following anonymous FTP sites. These mirror sites are kept frequently up to date. The sites marked with (H) may be mirroring ftp.cs.elte.hu instead of the primary site. Primary site ftp://ftp.zsh.org/pub/ http://www.zsh.org/pub/ Australia ftp://ftp.zsh.org/pub/ http://www.zsh.org/pub/ Denmark ftp://mirrors.dotsrc.org/zsh/ Finland ftp://ftp.funet.fi/pub/unix/shells/zsh/ France ftp://nephtys.lip6.fr/pub/unix/shells/zsh/ Germany ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ Hungary ftp://ftp.kfki.hu/pub/packages/zsh/ Poland ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/ The up-to-date source code is available via anonymous CVS and Git from Sourceforge. See http://sourceforge.net/projects/zsh/ for details. A summary of instructions for the CVS and Git archives can be found at http://zsh.sourceforget.net/. MAILING LISTS
Zsh has 3 mailing lists: <zsh-announce@zsh.org> Announcements about releases, major changes in the shell and the monthly posting of the Zsh FAQ. (moderated) <zsh-users@zsh.org> User discussions. <zsh-workers@zsh.org> Hacking, development, bug reports and patches. To subscribe or unsubscribe, send mail to the associated administrative address for the mailing list. <zsh-announce-subscribe@zsh.org> <zsh-users-subscribe@zsh.org> <zsh-workers-subscribe@zsh.org> <zsh-announce-unsubscribe@zsh.org> <zsh-users-unsubscribe@zsh.org> <zsh-workers-unsubscribe@zsh.org> YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED. All submissions to zsh-announce are automatically forwarded to zsh-users. All submissions to zsh-users are automatically forwarded to zsh-workers. If you have problems subscribing/unsubscribing to any of the mailing lists, send mail to <listmaster@zsh.org>. The mailing lists are main- tained by Karsten Thygesen <karthy@kom.auc.dk>. The mailing lists are archived; the archives can be accessed via the administrative addresses listed above. There is also a hypertext ar- chive, maintained by Geoff Wing <gcw@zsh.org>, available at http://www.zsh.org/mla/. THE ZSH FAQ
Zsh has a list of Frequently Asked Questions (FAQ), maintained by Peter Stephenson <pws@zsh.org>. It is regularly posted to the newsgroup comp.unix.shell and the zsh-announce mailing list. The latest version can be found at any of the Zsh FTP sites, or at http://www.zsh.org/FAQ/. The contact address for FAQ-related matters is <faqmaster@zsh.org>. THE ZSH WEB PAGE
Zsh has a web page which is located at http://www.zsh.org/. This is maintained by Karsten Thygesen <karthy@zsh.org>, of SunSITE Denmark. The contact address for web-related matters is <webmaster@zsh.org>. THE ZSH USERGUIDE
A userguide is currently in preparation. It is intended to complement the manual, with explanations and hints on issues where the manual can be cabbalistic, hierographic, or downright mystifying (for example, the word `hierographic' does not exist). It can be viewed in its current state at http://zsh.sourceforge.net/Guide/. At the time of writing, chapters dealing with startup files and their contents and the new completion system were essentially complete. THE ZSH WIKI
A `wiki' website for zsh has been created at http://www.zshwiki.org/. This is a site which can be added to and modified directly by users without any special permission. You can add your own zsh tips and configurations. INVOCATION
The following flags are interpreted by the shell when invoked to determine where the shell will read commands from: -c Take the first argument as a command to execute, rather than reading commands from a script or standard input. If any further argu- ments are given, the first one is assigned to $0, rather than being used as a positional parameter. -i Force shell to be interactive. It is still possible to specify a script to execute. -s Force shell to read commands from the standard input. If the -s flag is not present and an argument is given, the first argument is taken to be the pathname of a script to execute. If there are any remaining arguments after option processing, and neither of the options -c or -s was supplied, the first argument is taken as the file name of a script containing shell commands to be executed. If the option PATH_SCRIPT is set, and the file name does not con- tain a directory path (i.e. there is no `/' in the name), first the current directory and then the command path given by the variable PATH are searched for the script. If the option is not set or the file name contains a `/' it is used directly. After the first one or two arguments have been appropriated as described above, the remaining arguments are assigned to the positional parameters. For further options, which are common to invocation and the set builtin, see zsh-betaoptions(1). Options may be specified by name using the -o option. -o acts like a single-letter option, but takes a following string as the option name. For example, zsh -x -o shwordsplit scr runs the script scr, setting the XTRACE option by the corresponding letter `-x' and the SH_WORD_SPLIT option by name. Options may be turned off by name by using +o instead of -o. -o can be stacked up with preceding single-letter options, so for example `-xo shwordsplit' or `-xoshwordsplit' is equivalent to `-x -o shwordsplit'. Options may also be specified by name in GNU long option style, `--option-name'. When this is done, `-' characters in the option name are permitted: they are translated into `_', and thus ignored. So, for example, `zsh --sh-word-split' invokes zsh with the SH_WORD_SPLIT option turned on. Like other option syntaxes, options can be turned off by replacing the initial `-' with a `+'; thus `+-sh-word-split' is equivalent to `--no-sh-word-split'. Unlike other option syntaxes, GNU-style long options cannot be stacked with any other options, so for example `-x-shwordsplit' is an error, rather than being treated like `-x --shwordsplit'. The special GNU-style option `--version' is handled; it sends to standard output the shell's version information, then exits successfully. `--help' is also handled; it sends to standard output a list of options that can be used when invoking the shell, then exits successfully. Option processing may be finished, allowing following arguments that start with `-' or `+' to be treated as normal arguments, in two ways. Firstly, a lone `-' (or `+') as an argument by itself ends option processing. Secondly, a special option `--' (or `+-'), which may be specified on its own (which is the standard POSIX usage) or may be stacked with preceding options (so `-x-' is equivalent to `-x --'). Options are not permitted to be stacked after `--' (so `-x-f' is an error), but note the GNU-style option form discussed above, where `--shwordsplit' is permitted and does not end option processing. Except when the sh/ksh emulation single-letter options are in effect, the option `-b' (or `+b') ends option processing. `-b' is like `--', except that further single-letter options can be stacked after the `-b' and will take effect as normal. COMPATIBILITY
Zsh tries to emulate sh or ksh when it is invoked as sh or ksh respectively; more precisely, it looks at the first letter of the name by which it was invoked, excluding any initial `r' (assumed to stand for `restricted'), and if that is `s' or `k' it will emulate sh or ksh. Furthermore, if invoked as su (which happens on certain systems when the shell is executed by the su command), the shell will try to find an alternative name from the SHELL environment variable and perform emulation based on that. In sh and ksh compatibility modes the following parameters are not special and not initialized by the shell: ARGC, argv, cdpath, fignore, fpath, HISTCHARS, mailpath, MANPATH, manpath, path, prompt, PROMPT, PROMPT2, PROMPT3, PROMPT4, psvar, status, watch. The usual zsh startup/shutdown scripts are not executed. Login shells source /etc/profile followed by $HOME/.profile. If the ENV environ- ment variable is set on invocation, $ENV is sourced after the profile scripts. The value of ENV is subjected to parameter expansion, com- mand substitution, and arithmetic expansion before being interpreted as a pathname. Note that the PRIVILEGED option also affects the exe- cution of startup files. The following options are set if the shell is invoked as sh or ksh: NO_BAD_PATTERN, NO_BANG_HIST, NO_BG_NICE, NO_EQUALS, NO_FUNC- TION_ARGZERO, GLOB_SUBST, NO_GLOBAL_EXPORT, NO_HUP, INTERACTIVE_COMMENTS, KSH_ARRAYS, NO_MULTIOS, NO_NOMATCH, NO_NOTIFY, POSIX_BUILTINS, NO_PROMPT_PERCENT, RM_STAR_SILENT, SH_FILE_EXPANSION, SH_GLOB, SH_OPTION_LETTERS, SH_WORD_SPLIT. Additionally the BSD_ECHO and IGNORE_BRACES options are set if zsh is invoked as sh. Also, the KSH_OPTION_PRINT, LOCAL_OPTIONS, PROMPT_BANG, PROMPT_SUBST and SIN- GLE_LINE_ZLE options are set if zsh is invoked as ksh. RESTRICTED SHELL
When the basename of the command used to invoke zsh starts with the letter `r' or the `-r' command line option is supplied at invocation, the shell becomes restricted. Emulation mode is determined after stripping the letter `r' from the invocation name. The following are disabled in restricted mode: o changing directories with the cd builtin o changing or unsetting the PATH, path, MODULE_PATH, module_path, SHELL, HISTFILE, HISTSIZE, GID, EGID, UID, EUID, USERNAME, LD_LIBRARY_PATH, LD_AOUT_LIBRARY_PATH, LD_PRELOAD and LD_AOUT_PRELOAD parameters o specifying command names containing / o specifying command pathnames using hash o redirecting output to files o using the exec builtin command to replace the shell with another command o using jobs -Z to overwrite the shell process' argument and environment space o using the ARGV0 parameter to override argv[0] for external commands o turning off restricted mode with set +r or unsetopt RESTRICTED These restrictions are enforced after processing the startup files. The startup files should set up PATH to point to a directory of com- mands which can be safely invoked in the restricted environment. They may also add further restrictions by disabling selected builtins. Restricted mode can also be activated any time by setting the RESTRICTED option. This immediately enables all the restrictions described above even if the shell still has not processed all startup files. STARTUP
/SHUTDOWN FILES Commands are first read from /etc/zsh-beta/zshenv; this cannot be overridden. Subsequent behaviour is modified by the RCS and GLOBAL_RCS options; the former affects all startup files, while the second only affects global startup files (those shown here with an path starting with a /). If one of the options is unset at any point, any subsequent startup file(s) of the corresponding type will not be read. It is also possible for a file in $ZDOTDIR to re-enable GLOBAL_RCS. Both RCS and GLOBAL_RCS are set by default. Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zsh-beta/zprofile and then $ZDOT- DIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zsh-beta/zshrc and then $ZDOTDIR/.zshrc. Finally, if the shell is a login shell, /etc/zsh-beta/zlogin and $ZDOTDIR/.zlogin are read. When a login shell exits, the files $ZDOTDIR/.zlogout and then /etc/zsh-beta/zlogout are read. This happens with either an explicit exit via the exit or logout commands, or an implicit exit by reading end-of-file from the terminal. However, if the shell terminates due to exec'ing another process, the logout files are not read. These are also affected by the RCS and GLOBAL_RCS options. Note also that the RCS option affects the saving of history files, i.e. if RCS is unset when the shell exits, no history file will be saved. If ZDOTDIR is unset, HOME is used instead. Files listed above as being in /etc may be in another directory, depending on the installation. As /etc/zsh-beta/zshenv is run for all instances of zsh, it is important that it be kept as small as possible. In particular, it is a good idea to put code that does not need to be run for every single shell behind a test of the form `if [[ -o rcs ]]; then ...' so that it will not be executed when zsh is invoked with the `-f' option. Any of these files may be pre-compiled with the zcompile builtin command (see zsh-betabuiltins(1)). If a compiled file exists (named for the original file plus the .zwc extension) and it is newer than the original file, the compiled file will be used instead. FILES
$ZDOTDIR/.zshenv $ZDOTDIR/.zprofile $ZDOTDIR/.zshrc $ZDOTDIR/.zlogin $ZDOTDIR/.zlogout ${TMPPREFIX}* (default is /tmp/zsh*) /etc/zsh-beta/zshenv /etc/zsh-beta/zprofile /etc/zsh-beta/zshrc /etc/zsh-beta/zlogin /etc/zsh-beta/zlogout (installation-specific - /etc is the default) SEE ALSO
sh(1), csh(1), tcsh(1), rc(1), bash(1), ksh(1), zsh-betabuiltins(1), zsh-betacompwid(1), zsh-betacompsys(1), zsh-betacompctl(1), zsh-beta- expn(1), zsh-betamisc(1), zsh-betamodules(1), zsh-betaoptions(1), zsh-betaparam(1), zsh-betazle(1) IEEE Standard for information Technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities, IEEE Inc, 1993, ISBN 1-55937-255-9. zsh 4.3.17-dev-0-cvs0621 February 26, 2012 ZSH(1)