The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
shell programming nivas Shell Programming and Scripting 8 02-11-2008 12:06 PM
Aix Shell Programming akmtcs AIX 1 12-07-2006 08:40 AM
shell programming Neha Agarwal Shell Programming and Scripting 2 09-07-2005 03:23 AM
Shell Programming Help mec585858 UNIX for Dummies Questions & Answers 4 12-10-2003 10:24 AM
Shell Programming JWK1 UNIX for Dummies Questions & Answers 2 06-01-2001 02:31 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-02-2008
thungmail thungmail is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 11
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
And my script "script" is
Code:
#!/bin/sh
path=/home/tuan/Desktop/Shell_programming/List
for student in $path
do 
echo "$student"
done
At terminal I did :
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$
Why after executing, the script displayed
Code:
/home/tuan/Desktop/Shell_programming/List
If I would like to print out the name of student. What should I change the code for my script
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0