w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Amount of positional parameters in Linux shell script

You can loop through all the elements with $@:

#!/bin/bash
for dir in "$@"
do
   mv "$dir"/* /tmp
done

So that you don't have to know in advance how many parameters you are getting.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.