Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os
- import sys
- chain_len = 10
- prefix = "link_"
- if ( len( sys.argv ) > 1 ):
- if( len( sys.argv ) > 2 ):
- chain_len = int( sys.argv[2] )
- if( len( sys.argv ) > 3 ):
- prefix = sys.argv[3]
- os.system( "ln -s " + sys.argv[1] + " " + prefix + "0" )
- for i in range ( 1, chain_len ):
- os.system( "ln -s " + prefix + str(i-1) + " " + prefix + str(i) )
- else:
- print "ERROR: No filename given!\n"
- print "USAGE:"
- print "\t" + sys.argv[0] + " [TARGET FILE] [LENGHT] [PREFIX]\n"
- print "\tParamethers [LENGHT] and [PREFIX] are optional."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement