1. The problem statement, all variables and given/known data:
I have to make a manufacturing company. I need subdirectories for the company using three departments: Human Resources, Manufacturing, and Sales. I also need three scripts in order to create tables for each sub directory. Each script should ask for the department name, and for that department, create 5 sales persons with ID number and Name.
Stopping there (as there's more to ask, but i'm pretty sure i can finish the rest...)
2. Relevant commands, code, scripts, algorithms:
Vi Script[1-3] ? ? ?
mkdir
cd
3. The attempts at a solution (include all code and scripts):
1) mkdir Suit_and_Tie
2) cd Suit_and_Tie
3) mkdir Human Resources
4) mkdir Manufacturing
5) mkdir Sales
6) ???? I know i need a script, so using Vi Editor to start with will help. I am not familiar with the commands within it, especially in order to create tables that ask for each department name, so any help would be appreciated.
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Columbia Junior College - Sonora, California, USA, Ida Ponder, CMPSC9
What OS are you on?
Did you look at what you created with mkdir? (use ls -l ...)
Isnt there something wrong?...
Since a script is a text file, yes you will have to use vi... but I am not sure about tables for you seem only to begin so what you call tables I understand as "files" now its up to you to say how the the fields are separated...
A script will not be executable just like that so look at chmod command, and the commands you put in a shell script are not vi internals but true unix commands so read again your notes so far on the commands you already know and submit to us a beginning of script so we can do our comments if you wish...
You will need variables to store what people have typed
(hint: you will need read command, so look what it does in a shellscript...)
You will have to display your screen, what command do you use for that?
Once someone entered values in your variables, you will want to write their content in a file...
Ubuntu.
I'm not sure if anything is wrong, because all i needed was subdirectories within the "suit_and_tie" directory. I did look, and it's right where i needed it, at least i think so.. (you have me really thinking if i did something wrong now XD)
Yes, chmod 755 would work perfectly to make the script file executable, i believe.
By variables, do you mean system variables, like columns? Or how A = 1 and etc? I'm very slow when it comes to programming variables ....
Oh~ I did it the right way, i just typed it here, wrongly...
mkdir "Human Resources" is what i meant to put.
The script isn't made because i don't even know how to start it... I am not familiar with scripting too well, however, I have been researching since i've posted this, but still nothing... Guess i'm just really slow when it comes to scripting.
To start would be to write down the algorithm / pseudocode of what is being asked, once validated, transcript into shell code (commands).
Why 3 scripts?
Since you are asking for which dept.... One can do the job...
Because each script is going to be doing three different things.
Human Resources script will have the sales persons(five of more) with ID numbers and names within it.
Manufacturing script will have all the products manufactured with part numbers, product names, Cost of Manufacturing, and sell price with 40% markup or more.
and the Sales script will have all the products sold: Salesperson ID, part numbers, costs of goods sold, and gross profit.
After that, i need to generate a report, gathering data from each department's data files created by the scripts.
I simply do not know what my teacher means when she writes "Write three scripts to create tables, "flat database files, using colon delimiters. Each script should ask for the department name."
I cannot write pseudocode or an algorithm to something I don't even understand. So when I figure out the algorithm, i'll try starting the script...
i'll read some more on unix/linux shell scripts and programming shells, as well as variables, environment and configuration variables, shell variables, and operators.
---------- Post updated at 07:20 PM ---------- Previous update was at 10:21 AM ----------
Ahh! Here we go!!
How does this script sound?
Last edited by vbe; 04-16-2013 at 10:28 AM..
Reason: code tags, typos (missing $, t...) & indent...
Bootstrap is great; but we have had some issues with Bootstrapped <tables> (and legacy <fieldset> elements) showing annoying, wayward lines. I solved that problem today with this simple jQuery in the footer:
<script>
$(function(){
$('tr, td, fieldset,... (0 Replies)
Discussion started by: Neo
0 Replies
2. Forum Support Area for Unregistered Users & Account Problems
Hi,
I am trying to create a table through shell scripting . I used a command sqlplus -s to connect to sqlplus and user as sysdba. but there is a problem in it. can anyone please solve this .
#!/bin/bash
$(`sqlplus -s / as sysdba <<eof
create table sample (id,int);
insert into sample... (1 Reply)
Below is my code where i tried using table tag to print out put in table but its not working
#!/bin/ksh
#] && . ./.profile 2>/dev/null
if test -f '.profile'; then . ./.profile; fi;
#. .profile
LOG_DIR=/app/rpx/jobs/scripts/just/logs
sendEmail()
{
pzCType="$1";... (5 Replies)
I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email.
spool table_update.html;
SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription';
spool off;
exit;
Please use code tags next time for your code and data.... (9 Replies)
My Code is
get_week_date()
{
`sqlplus -s ${DQM_SQL_LOGON}@${DQM_SID} << EOF
SET ECHO OFF
SET FEEDBACK OFF
SET PAGES 0
SET SERVEROUTPUT ON
SET VERIFY OFF
SET TRIMSPOOL ON
(update file_level_qc fq set FQ.DATA_FILE_NAME='Hyvee_Pharmacy_Solutions_201304_v1.txt'... (2 Replies)
Okay. I've been charged with an assignment to create tables.
I "Made" a manufacturing company called "Suit and Tie". I need subdirectories for the company, using three departments: Human resources, Manufacturing, and Sales.
1) mkdir Suit_and_Tie
2) cd Suit_and_Tie
3) mkdir Human... (3 Replies)
Hi there,
im a beginner to the shell scripting.i trying to extract a table from a db(IMD) and i have to get the count of that table and size of the file.
can you help me out how to write the shall scriping for the above query. (2 Replies)
Hi
Can we create a rectangular table as i have attached in the query .
This is primarily for populating the created table with data gathered .
Hope I made myself clear ...
Pls suggest
Thanks (1 Reply)
Hi everyone,
I want to write a function which calculates the space needed between fields, to generate a table with aligned fields, like when you type "ls -l", the operating system generates a table with beautifully aligned fields.
I've got this code so far:
for line in $(cat tmpSearch)... (2 Replies)