The bags you are referring to actually contain
silica gel rather than salt. This material will just sit there in the bag, absorbing moisture from the air until such time as it is saturated. Silica gel can be regenerated by placing it in a hot oven in order to drive off the absorbed water.
Since hotels use grains of dried rice in their salt cellars to keep the salt free flowing, a bag of dried rice might work just as well if no silica gel is to hand.