• Complain

Anatole Olczak - The Korn Shell: Unix & Linux Programming Manual

Here you can read online Anatole Olczak - The Korn Shell: Unix & Linux Programming Manual full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2001, publisher: Addison-Wesley, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Anatole Olczak The Korn Shell: Unix & Linux Programming Manual
  • Book:
    The Korn Shell: Unix & Linux Programming Manual
  • Author:
  • Publisher:
    Addison-Wesley
  • Genre:
  • Year:
    2001
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

The Korn Shell: Unix & Linux Programming Manual: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The Korn Shell: Unix & Linux Programming Manual" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Anatole Olczak: author's other books


Who wrote The Korn Shell: Unix & Linux Programming Manual? Find out the surname, the name of the author of the book and a list of all author's works by series.

The Korn Shell: Unix & Linux Programming Manual — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The Korn Shell: Unix & Linux Programming Manual" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

The Korn Shell Unix Linux Programming Manual - image 1Korn Shell: Unix and Linux Programming Manual, Third Edition, TheBy Anatole Olczak


Appendix A. Sample .profile File

This appendix contains a sample .profile file. Notice that the environment variables are set and exported with one typeset command. This speeds up processing of the .profile file.

# # Sample .profile File # # Set/export environment variables typeset -x CDPATH=:$HOME:/usr/spool \ EDITOR=vi \ ENV=${HOME:-.}/.env \ HISTFILE=$HOME/.history \ HISTSIZE=200 \ HOME=/home/anatole \ LOGNAME=anatole \ MAILCHECK=300 \ MAILPATH=~/inbox:/usr/spool/mail/$LOGNAME \ PAGER=$(whence more) \ PATH=${PATH#:}:/usr/etc:$NEWS/bin: \ PS1='!:$PWD> ' \ PS4='[$LINENO]+ ' \ SHELL=/bin/ksh \ TERM=sun \ TMOUT=600 \ USER=$LOGNAME # Set global options set -o noclobber -o markdirs +o bgnice # Execute commands from the ~/.logout file on exit trap '. ~/.logout' EXIT


The Korn Shell Unix Linux Programming Manual - image 2Korn Shell: Unix and Linux Programming Manual, Third Edition, TheBy Anatole Olczak


Appendix B. Sample Environment File

This appendix contains a sample environment file. It sets the global functions, aliases, and prompt variable.

# # Sample env File # # Function md - make a directory and _cd to it function md { mkdir $1 && _cd $1 } # Set up the echo alias alias -x echo='print -' # Set temporary prompt variable to the command number # followed by a colon PS0='!:' # Function _cd - changes directories, then sets the # command prompt to: "command-number:pathname>" function _cd { if (($# == 0)) then 'cd' PS1="$PS0$PWD> " fi if (($# == 1)) then 'cd' $1 PS1="$PS0$PWD> " fi if (($# == 2)) then 'cd' $1 $2 PS1="$PS0$PWD> " fi } # Alias the cd command to the _cd function alias -x cd=_cd # Export the _cd and md functions typeset -fx _cd md


The Korn Shell Unix Linux Programming Manual - image 3Korn Shell: Unix and Linux Programming Manual, Third Edition, TheBy Anatole Olczak


Appendix C. C Shell Functionality

This appendix contains the source code listings for the C Shell directory management functions, and other miscellaneous C Shell commands.




The Korn Shell Unix Linux Programming Manual - image 4Korn Shell: Unix and Linux Programming Manual, Third Edition, TheBy Anatole Olczak
Appendix C. C Shell Functionality


Directory Functions

These Korn shell functions implement the C shell directory management commands: dirs , popd , and pushd . They can be put into a separate cshfuncs file and read in with the . command when necessary. Their basic functionality is:

dirs

display directory stack

popd

remove directory stack entry and cd to it

pushd

add directory stack entry and cd to it

The dirs function lists the current directory stack.

With no argument, the popd function removes the top entry (previous working directory) from the directory stack and changes directory to it. If a + n argument is given, then the nth directory stack entry ( nth previous working directory) is removed.

With no argument, the pushd function switches the top two entries (current and previous working directory) and changes directory to the previous working directory. This is equivalent to " cd ?/span>". If a directory argument is given, pushd puts the directory on the top of the directory stack and changes directory to it. If a + n argument is given, pushd puts the nth directory stack entry ( nth previous working directory) on the top of the stack and changes directory to it.

# # Sample C Shell Directory Management Functions # # Function fcd - verify accessibility before changing # to target directory function fcd { # Make sure directory exists if [[ ! -d $1 ]] then print "$1: No such file or directory" return 1 else # Make sure directory is searchable if [[ ! -x $1 ]] then print "$1: Permission denied" return 1 fi fi # Otherwise change directory to it cd $1 return 0 } # Function dirs - display directory stack function dirs { # Display current directory and directory stack print "$PWD ${DSTACK[*]}" } # Function pushd - add entry to directory stack function pushd { # Set stack depth (number of stack entries) integer DEPTH=${#DSTACK[*]} case $1 in "" )# No argument - switch top 2 stack elements if ((${#DSTACK[*]} < 1)) then print "$0: Only one stack entry." return 1 else fcd ${DSTACK[0]} || return DSTACK[0]=$OLDPWD dirs fi ;; +@([1-9])*([0-9])) # Number argument 1-999* - move entry to top # of directory stack and cd to it integer ENTRY=${1#+} if ((${#DSTACK[*]} < $ENTRY)) then print "$0: Directory stack not that deep" return 1 else fcd ${DSTACK[ENTRY-1]} || return DSTACK[ENTRY-1]=$OLDPWD dirs fi ;; * ) # Directory argument - verify argument # before changing directory and adjusting # rest of directory stack fcd $1 || return until ((DEPTH == 0)) do DSTACK[DEPTH]=${DSTACK[DEPTH-1]} ((DEPTH-=1)) done DSTACK[DEPTH]=$OLDPWD dirs ;; esac } # Function popd - remove entry from directory stack function popd { # Set stack depth (number of stack entries) integer i=0 DEPTH=${#DSTACK[*]} ENTRY=${1#+} case $1 in "" ) # No argument - discard top stack entry if ((${#DSTACK[*]} < 1)) then print "$0: Directory stack empty." return 1 else fcd ${DSTACK[0]} || return while ((i < (DEPTH-1))) do DSTACK[i]=${DSTACK[i+1]} ((i+=1)) done unset DSTACK[i] dirs fi ;; +@([1-9])*([0-9])) # Number argument 1-999* - discard nth # stack entry if ((${#DSTACK[*]} < ENTRY)) then print "$0: Directory stack not that deep" return 1 else while ((ENTRY < DEPTH)) do DSTACK[ENTRY-1]=${DSTACK[ENTRY]} ((ENTRY+=1)) done unset DSTACK[ENTRY-1] dirs fi ;; # Invalid argument given * ) print "$0: Invalid argument." return 1 ;; esac }



The Korn Shell Unix Linux Programming Manual - image 5Korn Shell: Unix and Linux Programming Manual, Third Edition, TheBy Anatole Olczak
Appendix C. C Shell Functionality


Miscellaneous Commands

The following sections contain Korn shell equivalents of some miscellaneous C shell commands and functions.

The .logout File

In the C shell, commands in the ~/.logout file are executed on exit . If the following command is added to the ~/.profile file, then the same thing will happen in the Korn shell:

trap '. ~/.logout' EXIT
The chdir Command

The C shell chdir command changes to the specified directory and can be set to a Korn shell alias like this:

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The Korn Shell: Unix & Linux Programming Manual»

Look at similar books to The Korn Shell: Unix & Linux Programming Manual. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The Korn Shell: Unix & Linux Programming Manual»

Discussion, reviews of the book The Korn Shell: Unix & Linux Programming Manual and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.