0
Basically I want to create a quick set of commands so that I can type into the terminal and have it do this:
cd /path/to/folder/of/symlink
sudo rm -f symlink
sudo ln -s /new/path/of/symlink
cd /new/path/of/symlink
I work for a company whose software is housed in a central location and uses symlinks to work around problems created by working out of a subversion repo branch (or whatever else) since the software relies on specific paths to run. My dilemma is that I tend to have to switch back and forth between various branches and the trunk on a regular basis (several times a day). So what I would like to do is at the very least create some type of script I can run in the terminal and enter a unique command example:
./subchange trunk
or
./subchange branch1
I don't mind having to hardcode the above stuff per folder I need to switch to, or making a unique identifier for each to make my life just a little easier, but I'm not sure how to actually create a script so that I can use it as a custom command or what kind of scripting I would need to use for it to work in linux. So any advice/help would be good for me at this point.
To get started, you're probably going to want to look at the topic of "bash shell scripting" for how to write scripts. You might also find the subject of "aliases" in bash a relevant topic. – Darth Android – 2012-08-21T17:44:38.543
@DanielBeck havent tried anything (yet).. Hence
but I'm not sure how to actually create a script so that I can use it as a custom command or what kind of scripting I would need to use for it to work in linux. So any advice/help would be good for me at this point.
– chris – 2012-08-21T17:46:08.900@DarthAndroid thank you, I will take a look into shell scripting and aliases, that will hopefully lead me on the path I am looking for. – chris – 2012-08-21T17:47:22.550
Of note, I personally recommend the Advanced Bash Scripting Guide. Don't dig too deep too fast (it gets into really advanced topics), but the introduction and basics assume you know nothing and should help you get started, and it's got great examples.
– Darth Android – 2012-08-21T17:51:10.717Very cool, yea I don't suspect Ill be digging to deep any time soon, Im just looking for what I hope is sweet and simple (to one extent or another). Then eventually as my needs get a bit bigger then Ill be more likely to start diving deeper :-) thanks again. – chris – 2012-08-21T17:53:28.577