After finishing open topics and question from last session . session 2 will be started.
- Redirection and Pipes
When you get the result of this command ,you were notified that u shouldn't list ur username on every entry .
once again some of your friends tells u that he want the file to appear like a funky format and he told u that the file is not changing ,what will u do ? there was an idea to run this
try to save the output.
- Command line completion
- File Operating and filtering-determine file contents-.
- Starting and handling background processes.
Using '&' to release console.
- Introduction to bash shell scripting .
&& = Logical AND || = Logical OR $ grep conceptor /etc/passwd || echo 'there is no conceptor entry'
I hope to finish all these topics , as far as I hope that audience understand them and practice.
- !/bin/bash read TIME session_end='8:30' then echo 'mount options , introduction to network commands' else echo 'See you later' fi
- Starting and handling background processes.
Comments
I think we need extra session
I think we need extra session for bash scripting, the time was not enough , while it was very benifitable
important variables
$? holds the exit code or return code of the previous command
$! holds the pid of the most recent backgrounded command.
for instance in my .xinitrc file I have pekwm& WMPID=$! ... #various desktop components ... wait $WMPID
this way the window manager starts before anything else and I still get to make it the session manager (ie the session ends when pekwm terminates, due to the wait clause).
another interesting example of scripting is making inteligent bash prompts here is mine which is ripped from somewhere
export T_normal='1;34' export T_bold=1 export T_underline=4 export C_owner='0;32' export C_write='0;36' export C_nowrite='0;31' export C_error='0;31' export DIRCOLOR=$T_normal export EXIT_CODE=0 export CODE_COLOR='4;31' export CODE_STRING= export USER_STYLE=$T_normal prompt_command() { EXIT_CODE=$? DIRCOLOR=$T_normal # Color-code directory then DIRCOLOR=$C_owner then DIRCOLOR=$C_write else DIRCOLOR=$C_nowrite fi # Add a bold red number for exitcode if its nonzero then #CODE_COLOR=$C_error CODE_STRING=\($EXIT_CODE\) else #CODE_COLOR=$T_normal CODE_STRING= fi # Underline username if ssh-agent is running then USER_STYLE=$T_underline else USER_STYLE=$T_normal fi } export PROMPT_COMMAND=prompt_command then else PS1='' fi then PS1='\u::\w$CODE_STRING$ ' else fi export PS1the funky bits are color codes ignore them.
cheers,
Alaa
"u know i once dream that the office of mobinil is from el 7`os :S and the one that answer u and tell u rasidak a girl called ghada"
إنـــا متشكر جد
إنـــا متشكر جداً على المجهود الكبير بتاعكوا ياجماعة . وضياء كان عشرة على عشرة . وقدر يوصلنا المعلومات اللى كنا محتجنها بس للأسف الوقت مكفاش علشان نشرح ال script فلو سمحتم عايزين حصة كمان علشان نقدر نخلص فيها كل Command Line . و ألف الف شكرا لتعبكوا معنا .
FLoOoDer