Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Create 2 different sets of links using command line argument

by noviceuser (Acolyte)
on Feb 11, 2021 at 18:08 UTC ( [id://11128251]=perlquestion: print w/replies, xml ) Need Help??

noviceuser has asked for the wisdom of the Perl Monks concerning the following question:

Hi users, i want to write a method in perl to create links for different cases like below

case 1: create link such as /home/rcap/br_19_16_Rel_RTM -> /lan/fed/rcrel/APCVS/br_19_16_Rel_RTM

case 2: create link such as /home/rcap/regs -> /lan/fed/rcrel/APCVS/br_19_16_Rel_RTM/regs

so when i give -l /home/rcap as command line argument to the script, it should create link as case 1 and,

when i give -l /home/rcap -b then it should create link such as case 2

where -b is a boolean value which should be passed only when case 2 is required

i am not able to achieve both the requirements in my script, any help will be appreciated

Replies are listed 'Best First'.
Re: Create 2 different sets of links using command line argument
by davido (Cardinal) on Feb 11, 2021 at 19:49 UTC

    Is there a language you already know how to implement this in? Do you have some code already in place? What fails?

    The canonical way of dealing with command line options in Perl is Getopt::Std for single character command-line switches, or Getopt::Long for single-char and long switches. Perl's facility for creating symlinks is symlink. If you have to make a path, Path::Tiny is useful.

    It's unclear where you're stuck. If the answer is "all of it", you probably have to start with perlintro.


    Dave

Re: Create 2 different sets of links using command line argument
by marto (Cardinal) on Feb 11, 2021 at 18:12 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11128251]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-29 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found