Hello! I am novice in Linux and bash scripting and need a little help in bash scripting. My version of Linux is 10.04 and bash ver. 4.1.5
So, I got this hometask from my university:
1) Create variable $hil amd store this string in it "Data files stored at ~/data"
Output its content on screen, then show first 6 symbols of it.
2) Add "Access granted (for user)" to the end of $hil.
Output it and exchange every letter "t" to "%%".
3) Write a command that will show "Yes" or "No" depending on if file "/proc/bus" is empty or not.
4) Show the the last line of file with extension .h from "/usr/include/linux" that begins with the word "If".
5) Write line 14 of file /usr/include/asm/errno.h in to the variable hl_2.
I have managed to do this:
Code:
hil="Data files stored at ~/data"
echo ${hil:1:6}
hil=${hil}"Access granted (for user)"
echo $hil
echo ${hill/t/%%}
So, i have managed to make first 2 tasks.
Please help me with the other 3. And, if possible, describe why this operator or that, so I will really learn something and not just Ctrl+C + Ctrl+V it in my *.sh file
Bookmarks