Difference between revisions of "Lab05"
From ACL@NCU
Line 1: | Line 1: | ||
=Linux | =Linux= | ||
#create symbolic link to a path | #create symbolic link to a path | ||
Line 18: | Line 18: | ||
you will be in "~/fmric", where all the contents of /media/DATA2/guests/public/Lab05 can be accessed. | you will be in "~/fmric", where all the contents of /media/DATA2/guests/public/Lab05 can be accessed. | ||
*Note: Deleting the symbolic link won't remove the contents of its destination. | *Note: Deleting the symbolic link won't remove the contents of its destination. | ||
#Loop with tcsh | |||
<pre> | |||
foreach <variable> (<list items>) | |||
<your command> | |||
end | |||
</pre> | |||
The statements above will iterate <your command> for the length of your list items. | |||
<pre> | |||
Example: | |||
#!/usr/bin/tcsh | |||
foreach run (1 2 3) | |||
echo $run | |||
end | |||
</pre> |
Revision as of 22:54, 18 November 2014
Linux
- create symbolic link to a path
ln -s <destination> <symbolic link>
- For example, typing the following command in your home directory (~):
ln -s /media/DATA2/guests/public/Lab05 fmric
- Create a symbolic link "fmric" pointing to "/media/DATA2/guests/public/Lab05" (assuming it exists). Thus, under your home directory, type:
cd fmric
you will be in "~/fmric", where all the contents of /media/DATA2/guests/public/Lab05 can be accessed.
- Note: Deleting the symbolic link won't remove the contents of its destination.
- Loop with tcsh
foreach <variable> (<list items>) <your command> end
The statements above will iterate <your command> for the length of your list items.
Example: #!/usr/bin/tcsh foreach run (1 2 3) echo $run end