|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Produces the application specified command to all regular files in a given directory
1. The problem statement, all variables and given/known data: write a script in language shell bash, which produces the application specified command to all regular files in a given directory (and all subdirectories) Input parameters: - Defined directory; - Given command. 2. Relevant commands, code, scripts, algorithms: 3. The attempts at a solution (include all code and scripts): this is my solution, but i'm not sure that it's true? Code:
#!/bin/bash
echo ' '
if [ "$1" = "" ]
then echo 'insert your directory, please'
else
if [ "$2" = "" ]
then echo 'insert your command, please'
else
find $1 -type f | xargs $2
fi
fi4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course): Hanoi university, Hanoi, VietNam Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it). |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Hanoi university, Hanoi, VietNam there is information missing! |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Produces the application specified command to all regular files in a given directory | numeracy | Shell Programming and Scripting | 1 | 05-13-2012 05:42 AM |
| linux sort command produces strange output | ajb | UNIX for Dummies Questions & Answers | 3 | 08-11-2011 12:17 PM |
| Apply 'awk' to all files in a directory or individual files from a command line | ScKaSx | Shell Programming and Scripting | 4 | 11-04-2010 06:50 PM |
| How to apply a regular expression in all the files in a directory | Lucky Ali | Shell Programming and Scripting | 2 | 11-01-2009 04:24 PM |
| Command to view files in Directory | VamsiVasili | Shell Programming and Scripting | 4 | 09-23-2009 05:34 PM |
|
|