Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Here is a python version' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Here is a python version
Authored by: buc40 on Jul 27, '02 01:21:22PM

Here is a python version taht does not require a login.

It does however require an aliases.mine file.

#!/usr/bin/env python
import os

user = raw_input("Enter username: ")
cmd = raw_input("Enter the CMD you want to make an alias for: ")
alias = raw_input("Enter the alias without quotes: ")
pound = raw_input("Enter a one line description for the alias: ")

file = "/Users/%s/Library/init/tcsh/aliases.mine" % user
output = "# %s n alias %s '%s' n" % (pound, cmd, alias)

fileout = open(file, "a")
fileout.write(output)
fileout.close()

See if it works for you.

Thanks.
SA



[ Reply to This | # ]
doesn't make the new alias immediately available
Authored by: hayne on Jul 29, '02 01:45:46AM

But, as far as I can see (not being very knowledgeable in Python), this script does not result in the new alias being immediately available. I.e. so that immediately after using the script you can make use of the new alias. That was the reason, I believe, for the re-login in the original script.



[ Reply to This | # ]