![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loop question ??? | skyineyes | Shell Programming and Scripting | 2 | 12-18-2008 01:00 AM |
| loop question | aliahsan81 | Shell Programming and Scripting | 5 | 11-21-2008 04:46 PM |
| For Loop Question | msb65 | Shell Programming and Scripting | 4 | 08-27-2008 04:36 AM |
| while loop question | stepnkev | Shell Programming and Scripting | 2 | 06-01-2007 10:51 AM |
| Loop question | strike | Shell Programming and Scripting | 18 | 04-13-2005 11:24 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
This sample script should obtain a list of files in my home directory:
#!/bin/bash # Manipulate files and copy to my home directory # for FILE in $HOME/.bash* do cp $FILE ${HOME}/public_html chmod a+r ${HOME}/public_html/${FILE} done Unfortunately it only produces an error: -bash-3.2$ ./fileloop.sh chmod: can't access /students/kporte01/public_html//students/kporte01/.bash_history chmod: can't access /students/kporte01/public_html//students/kporte01/.bash_profile chmod: can't access /students/kporte01/public_html//students/kporte01/.bashrc Running the script in debug mode, the result is: -bash-3.2$ ./fileloop.sh + for FILE in '$HOME/.bash*' + cp /students/kporte01/.bash_history /students/kporte01/public_html + chmod a+r /students/kporte01/public_html//students/kporte01/.bash_history chmod: can't access /students/kporte01/public_html//students/kporte01/.bash_history + for FILE in '$HOME/.bash*' + cp /students/kporte01/.bash_profile /students/kporte01/public_html + chmod a+r /students/kporte01/public_html//students/kporte01/.bash_profile chmod: can't access /students/kporte01/public_html//students/kporte01/.bash_profile + for FILE in '$HOME/.bash*' + cp /students/kporte01/.bashrc /students/kporte01/public_html + chmod a+r /students/kporte01/public_html//students/kporte01/.bashrc chmod: can't access /students/kporte01/public_html//students/kporte01/.bashrc Hmmm... what did I miss? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|