KSH

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions KSH
# 1  
Old 08-30-2012
Data KSH

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
1. Accept the user's first and last name and echo the entire name along with the some suitable comment.
2. Accept a pattern and a file name, and look for that pattern in that specified file.
3. List all files that haven been modified today.
4. Display long listing of only the regular files in the current directory.
5. Display details of all files in the 2 “paths” accepted from user. The display should be screen by screen.
6. Accept user name and verify if the user is currently logged on.
7. Let the script display its name and its PID.
8. Accept user name as input and display appropriate message based on whether the user has logged in.
9. Get the concatenated o/p of 2 files into a third file: Take 3 command line arguments: The first argument is the name of a destination file, and the other two arguments are names of files whose contents are to be placed in the destination file.



2. Relevant commands, code, scripts, algorithms:

As I am new to Unix I dont know to code the shell scripts.

3. The attempts at a solution (include all code and scripts):

The solution is that, As I dont know how to code pls guide me in this. Then will learn


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
govt college(BU), bangalore(Karnataka),India,Naganna,Bsc


Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
# 2  
Old 08-30-2012
You cant write shell scripts if you dont know a minimum of unix and at least know to use vi...
The fastest to start with would be to attend a full time (3-5 days) unix introduction cours like those given by our favorites vendors ( HP, SUN-ORACLE, IBM ...) or people dealing with linux... for it can be quite depressing to learn on your own from scratch... after, it is completing your knowledge and that depends more on the orientation you will take after...
But once you followed your "immersion" course, you are read to read the threads here in dummies and shell without being lost, you can then try to understand how folk work out given problems... and start to submit to our sagacity your solutions...

Start by immediately practicing vi, it will save you a lot of time later...
# 3  
Old 08-30-2012
I completely agree with vbe here...
# 4  
Old 08-30-2012
I know vi and even i know the extensions for tat. In vi i can write my code and all essentials so what else u need me to know about vi??
# 5  
Old 08-30-2012
How to go to line 150?
look for a word...?
Substitute a word with another, in a line, in all file?

more difficult (using buffers)

open 2 files, mark a block in the first remove it and insert it somewhere in the second...
# 6  
Old 08-30-2012
While at it, what unix commands do you know? We will try to use that to add commands for you to learrn and start basic things in order to be able to use them in scripts...
# 7  
Old 08-30-2012
ok fine ill learn from basics thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh

Hi Dears kindly I am new here ...I want to ask your help ... I want to write AWK command when enter date like 20140129 plus 9 then it gives me 20140207 I wrote below but the result was wrong #!/bin/ksh echo "please input the data:" read a if echo $a|awk '{if... (15 Replies)
Discussion started by: shaho87
15 Replies

2. Shell Programming and Scripting

ksh help

Hi, I have command like this with ooutput : unix>tnsping abc TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Production on 17-AUG-2011 17:06:11 Copyright (c) 1997, 2007, Oracle. All rights reserved. Used parameter files: /opt/oracle/network/admin/sqlnet.ora ... (19 Replies)
Discussion started by: talashil
19 Replies

3. Shell Programming and Scripting

different behaviour for ksh and ksh -x

I'm getting different behaviour when executing below script in debug option. $ cat ss.ksh ff=$(pwd) echo " ff : $ff" $ ksh ss.ksh ff : /tmp $ ksh -x ss.ksh + + pwd ff= + echo ff : ff : I was getting this behaviour in my actuall script i'm able to reproduce this in simple script... (4 Replies)
Discussion started by: luckybalaji
4 Replies

4. UNIX for Dummies Questions & Answers

Difference Between executing llike ./myscript.ksh and . ./myscript.ksh

Hi , What is the diffence between executing the script like ./myscript.ksh . ./myscript.ksh I have found 2 difference but could not find the reason 1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in... (5 Replies)
Discussion started by: max_hammer
5 Replies

5. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

6. Shell Programming and Scripting

Need help on ksh

1. Script using bash #!/bin/bash a=4294967296 (( b=$a / 2 )) echo "$a" echo "$b" *** output *** 4294967296 2147483648 2. Script using ksh #!/bin/ksh a=4294967296 (( b=$a / 2 )) echo "$a" echo "$b" *** output *** 4294967296 (3 Replies)
Discussion started by: gautam.shrestha
3 Replies

7. Shell Programming and Scripting

Help with KSH

Hi, I need some help with the Ksh scripting.... I have a Script call Mail.ksh which calls Crank.ksh which calls Readdates.ksh whoch calls mindiff.ksh the output of mindiff.ksh and Readdates.ksh are wirtten to a text file... Here is how each file is called or executed... ./Mail.ksh 30... (3 Replies)
Discussion started by: bhagya2340
3 Replies

8. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

9. Shell Programming and Scripting

tracing a ksh script within a ksh script

I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below...... vi hairy bear=`grep bear animals` if then ksh more_animals fi If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is... (1 Reply)
Discussion started by: shorty
1 Replies

10. Shell Programming and Scripting

executing a ksh script from another ksh script

Hi, I'm new to unix scripting.How can i call a script from another script. I have a.ksh and b.ksh .I have to call b.ksh from a.ksh after it is successfully exceuted. I tried using #!/bin/ksh -x in a.ksh and at the end i have used /path/b.ksh My problem is it is executing only a.ksh.it... (6 Replies)
Discussion started by: ammu
6 Replies
Login or Register to Ask a Question