Sponsored Content
Full Discussion: rm question
Top Forums UNIX for Dummies Questions & Answers rm question Post 302098349 by SeanWuzHere on Saturday 2nd of December 2006 11:04:52 PM
Old 12-03-2006
Quote:
Originally Posted by kapilraj
why do you want to do this ?

rm file1 file2 will delete file1 and file2 , rm * will delete everything. I can not undestand your requirement or this is a stupid requirement.

Regds,

Kaps
Yeah,.. I guess when we are first learning something people give us stupid questions to figure out. LOL. Believe me,.. I have way better things I'd rather spend my Saturday night doing but I have to get this finished. Also,.. just remember,.. this is probably really easy for you because you are probably an expert with this but I am just a n00b so there's a lot that doesn't make sense to me yet. But I'm getting better and better at it everday. Smilie

Well, anyway,.. I think I have it all figured out for the most part. Now I just have to make it so that if the number of arguments exceed the number specified in MAXFILES, then it will ask me to confirm the deletion. That shouldn't be too hard. Anyway,.. thanks all for the great help. Smilie

Here's my revised version which works the way I need it to for the most part.

Code:
#!/bin/bash
# Program: myrm

if [ -z "$MAXFILES" -a "$#" -ge 1 ]
then
        for MAXFILES in $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10}
        do
                echo "deleted$MAXFILES"
                shift
        done
        exit 1
fi

if [ -n "$MAXFILES" -a "$#" -ge 1 ]
then
        MAXFILES="$*"
        rm -rf $MAXFILES
fi

Then I just do something like this:

Code:
$ MAXFILES=56 ./myrm f1 f2 f3 f4
# then it deletes the 4 files because they are less than the amount specified in MAXFILES.
or
$ MAXFILES= ./myrm f1 f2 f3 f4

blah blah blah

Also,.. I have just an echo command in the top section just to make things easier. I'll go back and put the correct commands in there later. I just mainly needed to figure out HOW to do it and I think I got it now.
 

7 More Discussions You Might Find Interesting

1. Programming

Yet Another Question

Now that I have getch() to work, I have yet another problem. BTW, thank you for answering these questions, I do ask a lot, only because I am eager to know, what is a board used for anyways :) Ok, he's the problem... #include iostream.h #include conio.h int main() { char movement; ... (2 Replies)
Discussion started by: mbolthouse
2 Replies

2. Solaris

vi question

Im trying to edit a 113 meg file in VI and i get the error TMP FILE TOO LARGE. Does someone know how to get around this? Thanks! (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. UNIX for Dummies Questions & Answers

mv question

Hello if I like to move file from defined directories system to new directory that not contained any directories system structure . But I like to create the same file system structure as source directory for example : I have 2 directories: foo1 and foo2 foo1 have directories and foo2 have... (2 Replies)
Discussion started by: umen
2 Replies

4. UNIX for Dummies Questions & Answers

Question

hallo, ik heb hier een vraagje. hoeveel gebruikers kunnen er op 1 unix systeem. hopelijk antwoorden golle nu want ik moet da vinde voor school en die leerkracht zaagt. :p groetjes eu wacht wa was mijne nick ah ja vraagje groetjes vraagje ik kan geen engels dus antwoord liever in het... (1 Reply)
Discussion started by: vraagje
1 Replies

5. Shell Programming and Scripting

question about wc

Hey my friend was asking me if i knew a way to cout how many different words in a file. I told him no not off hand, but i was thinking about it, and i started to wonder also. I imagine this is probably pretty simple im just missing something, I keep confusing my self with how you would compair and... (16 Replies)
Discussion started by: yodadbl07
16 Replies

6. Hardware

question

How to add 3 moniters to a pc set up? (2 Replies)
Discussion started by: clicstic
2 Replies

7. AIX

df question

Hi, Can anyone please explain a little about df command. I have following question: Following example is showing % used as 4 where as total free blocks are 15.46 out of 16.00 MB blocks. df -m /test Filesystem MBblocks Free %Used Iused %Iused ... (5 Replies)
Discussion started by: itsabhi9
5 Replies
asadmin-delete-acl(1AS) 					   User Commands					   asadmin-delete-acl(1AS)

NAME
delete-acl - removes the access control list file SYNOPSIS
delete-acl --user admin_user[--password admin_password][--host localhost] [--port 4848][--passwordfile filename][--secure|-s][--instance instance_name] acl_ID Gets the access control lists associated with the named server instance.. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --secure indicates communication with the administrative instance in secured mode. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --instance name of the instance. OPERANDS
acl_ID internal name for the ACL file listing. This ID is used in a virtual server element to define the ACL file used by the virtual server. Example 1: Using delete-acl asadmin> delete-acl --user admin --password adminadmin --host fuyako --port 7070 --instance server1 sampleACL Deleted ACL with id = sampleACL Where: sampleACL is the ACL that is deleted. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Access Control List page asadmin-create-acl(1AS), asadmin-list-acl(1AS) J2EE 1.4 SDK March 2004 asadmin-delete-acl(1AS)
All times are GMT -4. The time now is 10:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy