![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell programming | nivas | Shell Programming and Scripting | 8 | 02-11-2008 08:06 AM |
| Aix Shell Programming | akmtcs | AIX | 1 | 12-07-2006 04:40 AM |
| shell programming | Neha Agarwal | Shell Programming and Scripting | 2 | 09-06-2005 11:23 PM |
| Shell Programming Help | mec585858 | UNIX for Dummies Questions & Answers | 4 | 12-10-2003 06:24 AM |
| Shell Programming | JWK1 | UNIX for Dummies Questions & Answers | 2 | 06-01-2001 10:31 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
need help for shell programming
My purpose was to print out all of name of students in a list.First of all,I created a file name "List" in /home/tuan/Desktop/Shell_programming as below
Code:
Tom Henry Ben Linda Marry Code:
#!/bin/sh path=/home/tuan/Desktop/Shell_programming/List for student in $path do echo "$student" done Code:
tuan@tuan:~/Desktop/Shell_programming$ chmod +x script tuan@tuan:~/Desktop/Shell_programming$ /.script tuan@tuan:~/Desktop/Shell_programming$ ./script /home/tuan/Desktop/Shell_programming/List tuan@tuan:~/Desktop/Shell_programming$ Code:
/home/tuan/Desktop/Shell_programming/List |
| Forum Sponsor | ||
|
|
|
|||
|
First try changing yourself with someone who knows unix-shell before writing shell-scripts or at least someone who learns first and then writes code
Then, maybe change "$path" to `cat $path` in the for-statement |