For example, I want to be able to type into the terminal "task directory_name".
I tried this but it didn't work:
Code:
function_name() { cd $1 tar czf /~/destdir/$1.tar * return 0 } alias task=function_name
What am I doing wrong?
function_name() { cd $1 tar czf /~/destdir/$1.tar * return 0 } alias task=function_name
function Return { echo $1 } case "$1" in "" ) echo "give parameters please";; [0-9]* ) echo "No numbers please";; * ) Return;;
# !/bin/bash # A convenience function, to save us some work update_server() { # Read the app id and the directory into a variable APP_ID=$1 DIR=$2 # Create the directory ( if it does not exist already ) if [ ! -d "$HOME/$DIR" ]; then mkdir -p "$HOME/$DIR" fi # Uh-oh, it looks like we still have no directory. Report an error. if [ ! -d "$HOME/$DIR" ]; then # Describe what went wrong echo "ERROR! Cannot create directory $HOME/$DIR!" # Exit with status code 1 ( which indicates an error ) exit 1 fi # Call SteamCMD with the app ID we provided and tell it to install ./bin/steamcmd.sh +login anonymous +force_install_dir "$HOME/$DIR" +app_update $APP_ID validate +quit } # Now the script actually runs update_server ( which we just declared above ) with the id of the application ( 4020 is Garry's Mod ) and the name of the directory we want the server to be hosted from: update_server 4020 "gmodserver" exit 0
local_enable=YES chroot_local_users=YES
Match user alankoh X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp ChrootDirectory /home/%u
ssh root@192.168.1.50 -t vim vim scp://192.168.1.50/.bashrc vim scp://192.168.1.50/root/.bashrc ssh root@192.168.1.50 bash --norc ssh root@192.168.1.50 /bin/bash --norc --noprofile ssh -T root@192.168.1.50 "mv /root/.bashrc /root/.bashRC" scp .bashrc root@192.168.1.50:/root/ ssh root@192.168.1.50 /bin/bash --norc --noprofile -vvvvvvvvvv ssh -vvvvvv root@192.168.1.50 /bin/bash --norc --noprofile ssh -vvvvvv root@192.168.1.50 /bin/mv /root/.bashrc /root/.bashRC ssh -t -t root@192.168.1.50 << EOF mv /root/.bashrc /root/.bashRC EOF ssh -t -t root@192.168.1.50 --norc << EOF echo HELLO > /root/.bashrc EOF ssh -tv root@192.168.1.50 rm .bashrc
#include "wavelet2d.h"
#include "wavelet2s.h"
gcc -L/home/mario/wavelet/wavelib/linuxstatic -lwavelet2s wavedemo1.cpp -o wavedemo1
alice@alice:~$ grep 1003 /etc/group alice:x:1003: alice@alice:~$ grep 1003 /etc/passwd alice:x:1003:1003:Alice,,,:/home/alice:/bin/bash
alice@alice:~$ ls -ld dollstuff drwxrwxr-x 2 alice alice 4096 Jan 28 10:55 dollstuff
alice@alice:~$ grep 1005 /etc/group common:x:1005:alice,dilbert,wally
alice@alice:~$ chgrp common dollstuff chgrp: changing group of ‘dollstuff’: Operation not permitted