![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names | nikosey | Shell Programming and Scripting | 6 | 07-30-2008 09:46 PM |
| file moving based on file content | melvyn.cochrane | Shell Programming and Scripting | 12 | 02-15-2008 06:10 AM |
| Problem while moving a file | smvel | Shell Programming and Scripting | 5 | 06-10-2005 04:06 AM |
| moving a file? | Holistic | UNIX for Dummies Questions & Answers | 1 | 02-20-2003 07:47 PM |
| moving or removing a file | rooh | UNIX for Dummies Questions & Answers | 3 | 01-02-2002 02:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, I am fairly new to writing scripts.
I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from the directory, asking the user to confirm if he/she wants to move this file or not. And -a to move all the files to the other directory. I would really appreciate any help that anyone can give me. Thanks Joeh. |
|
|||||
|
Maybe getopts is interessting for you:
Linux.com :: SysAdmin to SysAdmin: More power with bash getopts Else you can try parsing $1 and $2 (shell parameter variables) with if/then/fi or case etc. |
![]() |
| Bookmarks |
| Tags |
| dir, directory, move, operators, scripts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|