How to rmdev a list of hdisk in one shot in AIX

0

In AIX I have a long list (more then 30) of hdisks I need to delete them in one shot, what command can I use?

AlBouazizi

Posted 2011-10-13T08:52:50.420

Reputation: 539

Answers

2

Generic answer for any command on any Unix-like OS:

while read -r item; do
    rmdev "$item"
done < itemlist.txt

Or:

xargs -d'\n' -n1 rmdev < itemlist.txt

user1686

Posted 2011-10-13T08:52:50.420

Reputation: 283 655

2

for hdisk in $(cat hdisk.txt);
do;
   rmdev -Rl $hdisk;
done

EM Morrow

Posted 2011-10-13T08:52:50.420

Reputation: 31

1Could you perhaps expand on the answer to explain how it works? It's not terribly difficult to understand, but not everyone is familiar with the syntax of AIX terminal commands. Explaining how it works will make the answer better for future visitors to the site. – Jonathan Garber – 2013-12-06T19:29:49.517