11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appen<strong>di</strong>ce A. Script aggiuntivi<br />

0-n Goto previous <strong>di</strong>rectory (0 is previous, 1 is last but 1, etc.)<br />

n is up to max history (default is 50)<br />

@ List history and special entries (Usually available as $ @)<br />

@h List history entries<br />

@s List special entries<br />

-g [] Go to literal name (bypass special names)<br />

This is to allow access to <strong>di</strong>rs called ’0’,’1’,’-h’ etc<br />

-d Change default action - verbose. (See note)<br />

-D Change default action - silent. (See note)<br />

-s Go to the special entry <br />

-S Go to the special entry and replace it with the current <strong>di</strong>r<br />

-r [] Go to <strong>di</strong>rectory and then put it on special entry <br />

-R [] Go to <strong>di</strong>rectory and put current <strong>di</strong>r on special entry <br />

-a Alternative suggested <strong>di</strong>rectory. See note below.<br />

-f [] File entries to .<br />

-u [] Update entries from .<br />

If no filename supplied then default file (~/cdfile) is used<br />

-F and -U are silent versions<br />

-v Print version number<br />

-h Help<br />

-H Detailed help<br />

Examples<br />

========<br />

These examples assume non-default mode is set (that is, cd with no<br />

parameters will go to the most recent stack <strong>di</strong>rectory), that aliases<br />

have been set up for cd and @ as described above and that cd’s prompt<br />

facility is active and the prompt length is 21 characters.<br />

/home/phil$ @ # List the entries with<br />

History: # Output of the @ comman<br />

..... # Skipped these entries<br />

1 /home/phil/ummdev S1 /home/phil/perl # Most recent two histor<br />

0 /home/phil/perl/eg S0 /home/phil/umm/ummdev # and two special entrie<br />

/home/phil$ cd /home/phil/utils/Cdll # Now change <strong>di</strong>rectories<br />

/home/phil/utils/Cdll$ @ # Prompt reflects the <strong>di</strong><br />

History: # New history<br />

.....<br />

1 /home/phil/perl/eg S1 /home/phil/perl # History entry 0 has mo<br />

0 /home/phil S0 /home/phil/umm/ummdev # and the most recent ha<br />

To go to a history entry:<br />

/home/phil/utils/Cdll$ cd 1 # Go to history entry 1.<br />

/home/phil/perl/eg$ # Current <strong>di</strong>rectory is n<br />

To go to a special entry:<br />

/home/phil/perl/eg$ cd -s1 # Go to special entry 1<br />

758

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!