Actually you would indeed struggle to pass $1 through to dsmadmc, however you could use macros instead:
function delnode { if [ -z "$1" ]; then # Empty $1 positional parameter. Show some help message echo "delnode <nodename>" else # Create a dsmadmc.command macro file echo "rem repln $1" >> dsmadmc.command echo "decom n $1" >> dsmadmc.command # Run the macro on both servers dsmadmc -id=<username> -se=<primary server> "macro dsmadmc.command" dsmadmc -id=<username> -se=<repl server> "macro dsmadmc.command" # Delete the dsmadmc.command file rm dsmadmc.command fi } --- Szabi Nagy Systems and Storage Administrator HFS Backup & Archive Services ________________________________ From: Szabi Nagy Sent: 17 December 2018 10:46:26 To: ADSM-L@VM.MARIST.EDU Subject: Re: [ADSM-L] more sophisticated way to delete nodes that are replicated? Why not use a function in your .bashrc instead? Maybe something like this: function delnode { if [ -z "$1" ]; then # Empty $1 positional parameter. Show some help message echo "delnode <nodename>" else # Remove and decommission the node from both primary and replication servers dsmadmc -id=<username> -se=<primary server> "rem repln $1" <<<=== Might be tricky to get $1 across to dsmadmc dsmadmc -id=<username> -se=<primary server> "decom n $1" dsmadmc -id=<username> -se=<repl server> "rem repln $1" dsmadmc -id=<username> -se=<repl server> "decom n $1" fi } You can add some more error checking, etc to it. After all, you are deleting nodes. --- Szabi Nagy Systems and Storage Administrator HFS Backup & Archive Services ________________________________ From: ADSM: Dist Stor Manager <ADSM-L@VM.MARIST.EDU> on behalf of Bjørn Nachtwey <bjoern.nacht...@gwdg.de> Sent: 14 December 2018 12:36:36 To: ADSM-L@VM.MARIST.EDU Subject: [ADSM-L] more sophisticated way to delete nodes that are replicated? Dear all, i just started to use replication and it looks to be a good approach to replace the copy pools i till now. But one point seems to become much more complicated: deleting nodes. The only way i see up to now takes some steps and two times to log on: log on to the primary server: 1) rem repln <nodename> 2) decom n <nodename> log on to the repl server: 3) rem repln <nodename> 4) decom n <nodename> but how to simplify this? i tried to put the commands in script, doing step 3 and 4 using command routing, but it does not work. So: Does anybody know a more sophisticated approach? => perfectly it would work with a single command / script call :-) thanks in advance Bjørn -- -------------------------------------------------------------------------------------------------- Bjørn Nachtwey Arbeitsgruppe "IT-Infrastruktur“ Tel.: +49 551 201-2181, E-Mail: bjoern.nacht...@gwdg.de -------------------------------------------------------------------------------------------------- Gesellschaft für wissenschaftliche Datenverarbeitung mbH Göttingen (GWDG) Am Faßberg 11, 37077 Göttingen, URL: http://www.gwdg.de Tel.: +49 551 201-1510, Fax: +49 551 201-2150, E-Mail: g...@gwdg.de Service-Hotline: Tel.: +49 551 201-1523, E-Mail: supp...@gwdg.de Geschäftsführer: Prof. Dr. Ramin Yahyapour Aufsichtsratsvorsitzender: Prof. Dr. Norbert Lossau Sitz der Gesellschaft: Göttingen Registergericht: Göttingen, Handelsregister-Nr. B 598 -------------------------------------------------------------------------------------------------- Zertifiziert nach ISO 9001 --------------------------------------------------------------------------------------------------