![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| ls while read loop - internal read picking up wrong input | dkieran | Shell Programming and Scripting | 2 | 05-14-2007 12:02 PM |
| read/writte/input data in file. | dorek | Shell Programming and Scripting | 0 | 06-22-2006 04:31 AM |
| Read the lines from the file in batch | amitraorane | Shell Programming and Scripting | 2 | 01-26-2006 10:51 AM |
| read a file as input and pass each line to another script | sajjad02 | Shell Programming and Scripting | 0 | 09-24-2004 08:13 PM |
| trying to read batch process but need some command help | etravels | Shell Programming and Scripting | 1 | 11-19-2003 07:48 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
read input file for batch job
hi all,
I am a newbie in unix shell script. May I know how to write a bacth job to read a list of files afrom the inout file and do the chmod ? Thanks. i.e. inside input.txt ==== a.txt b.txt c.txt and I want to write a batch job to read the input .txt and do the chmod 755 for all 3 files in the input.txt thx in advance! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
I don't understand - you stated in your other post about the exact same thing that you were going to use if statements - yet, you post the exact same question with no code. Either post the code you have been busy working on and questions about problems with it, or use the suggestions from the replies in your other post. Thanks.
|
|
#3
|
|||
|
|||
|
Hi kinmak,
If you want to grant full permissions mode to the files (777),your shell script should be as the following: #! /bin/ksh cat input.txt | while read line do chmod 777 $line >/dev/null 2>&1 done Good luck! Nir |
|
#4
|
||||
|
||||
|
Quote:
Code:
while read line
do
chmod 777 "${line}" >/dev/null 2>&1
done < input.txt
Last edited by Perderabo; 07-08-2007 at 12:38 PM. Reason: Update UUOC URL |
|
#5
|
||||
|
||||
|
kinmak, please read our rules and note in particular:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly. I removed your duplicate post from that other thread. |
|
#6
|
||||
|
||||
|
what about
Code:
chmod 777 `cat input.txt` |
|
#7
|
|||
|
|||
|
Hi Vgersh99 ,
Thansk for yourr reply... may I know what does this part of command mean >/dev/null 2>&1 ? thx |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|