LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help ME!! bash script (https://www.linuxquestions.org/questions/linux-newbie-8/help-me-bash-script-4175594598/)

ang2183727 12-01-2016 01:51 PM

Help ME!! bash script
 
i am fairly new at bash scripting. i have a problem that i want to understand more.

how would i create a script (name).sh that sets an alias for the less command so that it will diplay numbers when 1 is used and the filename passed.

then reads th /etc/passwd file, ise the variable Line to store the data

Also uses a function to process the data from /etc/passwd
a) use the global variable,Line, when processing the data
b) information passed to the function from the main script is:
1. the username field number
2. the UID field number
c) the function will determine which UIDs are less than 100 and then write thoe to a file named: results.me.txt in the users home directory
i: use the form:

goumba 12-01-2016 01:55 PM

Smells like homework. What have you come up with so far?

ang2183727 12-01-2016 02:01 PM

yes as a second assignment i feel is pretty advanced, so i have gone into vim and set up the script but i am having trouble with the alias command

Ztcoracat 12-01-2016 02:19 PM

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

TB0ne 12-01-2016 05:50 PM

Quote:

Originally Posted by ang2183727 (Post 5636777)
yes as a second assignment i feel is pretty advanced, so i have gone into vim and set up the script but i am having trouble with the alias command

Ok..so tell us what trouble you're having. We can't guess...even more helpful if you actually posted what you've done/tried.

Ztcoracat 12-01-2016 08:29 PM

Post the output of the script you made in vim so TB0ne can read it.

We can't advise you on something we can't see.


All times are GMT -5. The time now is 12:13 AM.