Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: unix script  (Read 4977 times)

0 Members and 1 Guest are viewing this topic.

genabryant

  • Guest
unix script
« on: March 28, 2010, 02:59:22 PM »
i need to know ( a description if possible) of what these scrpits are asking from the server to perform.  Unix C shell

alias setprompt 'set prompt="${cwd}% " '
setprompt                                 # to set the initial prompt
alias cd 'chdir \!* && setprompt'

Salmon Trout

  • Guest
Re: unix script
« Reply #1 on: April 03, 2010, 11:12:02 AM »
Each line is setting an alias. An alias is a piece of text, when typed at the prompt, or included in a script, that is expanded to something else. This is often done to save typing long commands.

alias lion 'large fierce carnivorous animal'

In your question, the first alias arranges that when the user types 'setptompt' this is expanded to 'set prompt="${cwd}% " ' This command makes the prompt equal to a dollar sign followed by the current working directory followed by a percent sign. The second alias ensures that when a user types cd this is expanded to 'chdir \!* && setprompt' This expands to 'chdir (change directory) to whatever directory is typed after cd and then run setprompt (which is expanded as above)'

THis looks like a normal part of an ordinary login script.





darkshadow67

  • Guest
Re: unix script
« Reply #2 on: April 13, 2010, 12:47:22 AM »
Rewrite the following sequence of commands using sort as a filter: You should end up with a single command line when you are done.
$ sort roster > temp -
$ lp temp
$ rm temp

Salmon Trout

  • Guest
Re: unix script
« Reply #3 on: April 13, 2010, 03:42:24 PM »
what is the point of your post, darkshadow67?