Skip to content
Advertisement

pass the date from outside as a parameter

This is my Linux script, I want to ask the user from outside what date is needed, then save that date and run the script for that date.

JavaScript

now currently this script generate a csv for the current date files, I want to run this for a user request date, can I pass parameters from outside? any help could be useful.

Advertisement

Answer

What do you mean by outside? Do you want to pass parameters when running the script? If so, you can run the script with

JavaScript

and use this argument with

JavaScript

This is parameter number one, since the null parameter is the name of the script.

Also, you can validate a date string with

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement