Skip to content

Commit 7178985

Browse files
authored
Update README.md
1 parent ad51bff commit 7178985

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

README.md

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
1-
# AmigaAssign
2-
A bash script to provide Amiga style assign command.
3-
4-
# What is this thing
5-
This script adds an Amiga like ASSIGN command to Linux (using a bash script).
6-
It allows paths to be referenced by a short, convenient name instead of the
1+
# AmigaAssign
2+
A bash script to provide Amiga style assign command to Linux.
3+
4+
# What is this thing
5+
This script adds an Amiga like ASSIGN command to Linux (using a bash script).
6+
It allows paths to be referenced by a short, convenient name instead of the
77
full path string. It is like an alias for paths instead of commands.
88

9-
A quick example.
10-
11-
```bash
9+
A quick example.
10+
11+
```bash
1212
/home/user$ assign docroot /var/www/html
1313
/home/user$ ls $docroot
1414
index.html
1515
/home/user$ cp website.html $docroot
16-
/home/user$ chmod a+r $docroot/website.html
17-
```
18-
19-
# History
20-
A long time ago there was this computer call the Amiga. On the Amiga you
21-
accessed different drives using a name followed by a colon (:). This is
22-
similar to how Windows uses a letter followed by a colon (for example "C:").
23-
On the Amiga drives where not limited to a single letter but used a name.
16+
/home/user$ chmod a+r $docroot/website.html
17+
```
18+
19+
# History
20+
A long time ago there was this computer call the Amiga. On the Amiga you
21+
accessed different drives using a name followed by a colon (:). This is
22+
similar to how Windows uses a letter followed by a colon (for example "C:").
23+
On the Amiga drives where not limited to a single letter but used a name.
2424
For example DF0: was the first disk drive.
2525

26-
The interesting thing was you could also make up new device names and set
27-
them a path on another drive. So for example you could setup WORK: to be
28-
on HD0:MyWork/Current. You could then access it using commands like
29-
"dir WORK:" or "copy file WORK:new_name". This was done with the assign
26+
The interesting thing was you could also make up new device names and set
27+
them a path on another drive. So for example you could setup WORK: to be
28+
on HD0:MyWork/Current. You could then access it using commands like
29+
"dir WORK:" or "copy file WORK:new_name". This was done with the assign
3030
command.
3131

32-
This is something like it for the bash shell. It adds an assign command
33-
that you "assign" a path name to a bash variable that can then be used
34-
as a shortcut for that path.
35-
36-
# How to install
37-
Take the "bash_assigncmd" script and copy it to your home directory
38-
under the name ".bash_assigncmd" (cp bash_assigncmd ~/.bash_assigncmd).
39-
Next source this script from one of your bash startup scripts.
40-
I suggest adding it to your .bashrc file (add the line
41-
"source ~/.bash_assigncmd").
42-
43-
Run this command to add the line.
44-
```bash
45-
echo "source ~/.bash_assigncmd" >>~/.bashrc
46-
```
47-
48-
# Usage
49-
After you have installed the assign command and source it
50-
(but typing ~/.bash_assigncmd or opening a new term window) you
51-
can start using it.
52-
53-
```
32+
This is something like it for the bash shell. It adds an assign command
33+
that you "assign" a path name to a bash variable that can then be used
34+
as a shortcut for that path.
35+
36+
# How to install
37+
Take the "bash_assigncmd" script and copy it to your home directory
38+
under the name ".bash_assigncmd" (cp bash_assigncmd ~/.bash_assigncmd).
39+
Next source this script from one of your bash startup scripts.
40+
I suggest adding it to your .bashrc file (add the line
41+
"source ~/.bash_assigncmd").
42+
43+
Run this command to add the line.
44+
```bash
45+
echo "source ~/.bash_assigncmd" >>~/.bashrc
46+
```
47+
48+
# Usage
49+
After you have installed the assign command and source it
50+
(but typing ~/.bash_assigncmd or opening a new term window) you
51+
can start using it.
52+
53+
```
5454
Usage:
5555
assign [OPTIONS] var [path]
5656
5757
Options:
58-
-d -- Delete assignment
59-
```
60-
61-
# Adding a new assign
62-
To add a new assignment the first argument is the new assignment name
63-
you want to add. This is a bash variable and has the same rules that all
64-
bash variables have. The second argument is the path you want to assign
58+
-d -- Delete assignment
59+
```
60+
61+
# Adding a new assign
62+
To add a new assignment the first argument is the new assignment name
63+
you want to add. This is a bash variable and has the same rules that all
64+
bash variables have. The second argument is the path you want to assign
6565
to this variable.
6666

67-
So for example "assign test /home/user/test" is the same
68-
as "export test=/home/user/test". The difference between exporting
69-
the var and using the assign command is that the assign command
70-
remembers the var between sessions (and is also available to all
71-
future sessions).
72-
73-
## Add examples
74-
Here are some examples of adding vars using assign.
75-
76-
Example | Use | Expands to
67+
So for example "assign test /home/user/test" is the same
68+
as "export test=/home/user/test". The difference between exporting
69+
the var and using the assign command is that the assign command
70+
remembers the var between sessions (and is also available to all
71+
future sessions).
72+
73+
## Add examples
74+
Here are some examples of adding vars using assign.
75+
76+
Example | Use | Expands to
7777
--------------------------------- | ------------------------------------- | -----------------------------------------------
7878
`assign c /` | `ls $c` | `ls /`
7979
`assign doc /home/user/Documents` | `cp instructions.pdf $doc` | `cp instructions.pdf /home/user/Documents`
8080
`assign down ~/Downloads` | `cat $down/AscIITable.txt` | `cat ~/Downloads/AscIITable.txt`
8181
`assign docroot /var/www/html` | `chmod 777 $docroot/site1/index.html` | `chmod 777 /var/www/html/site1/index.html`
82-
82+
8383
## Deleting an assignment
8484
You delete an assignment using the -d option followed by the assignment to delete. It will be freed from this point on.
8585

0 commit comments

Comments
 (0)