- Thread Starter
- #26
If you don't want to change to /usr/src everytime you update the src tree you could
put this in .cshrc:
or this in .shrc
====
The fish shell didn't like this sort of syntax, so I had to use this in ~/.config/fish/config.fish:
It may prompt for a password or not depending upon the sudoers file.
====
...or a perl script:
put this in .cshrc:
alias src-update "( cd /usr/src; sudo git pull ) ;"
or this in .shrc
alias src-update="( cd /usr/src; sudo git pull ) ;"
====
The fish shell didn't like this sort of syntax, so I had to use this in ~/.config/fish/config.fish:
alias src-update 'set var $PWD ; cd /usr/src/ ; sudo git pull ; cd $var'
It may prompt for a password or not depending upon the sudoers file.
====
...or a perl script:
Code:
#!/usr/local/bin/perl -w
#------------------------------------------#
# PROGRAM: src-update #
#------------------------------------------#
$dir="/usr/src";
$var="sudo git pull";
chdir( $dir ) or die "Couldn't go inside $dir directory, $!";
system("$var");
Last edited: