How to add notes at the end of shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to add notes at the end of shell script
# 1  
Old 04-09-2007
How to add notes at the end of shell script

i was wondering how to add a notes section for the user to enter in a shell script, as my shell script is a menu based on configurations of hardware and software

help is appreciated
# 2  
Old 04-09-2007
You can add notes by using "echo" command.

If it is not, pls give an example...that would be helpful
# 3  
Old 04-09-2007
thanks but ive already done that to display messages on the screen, im looking for an option for the user to run my script and then add notes to it such as like a text box

for example

user has a menu

1.machine info
2.software info
3.network info

once the user has chosen the option the results are given and then if possible given a text box to enter notes
# 4  
Old 04-09-2007
Use Select

In my understanding of the problem, the following script could be one possible solution.

cat sel.lsh
HTML Code:
#!/bin/ksh
PS3="Select an option from the menu:"
select OPT in Create Delete Add
do
 print $OPT selected
 print "Enter your comments : \c"
 read Text
 print "You Entered :$Text "
 break;
done
Please let us know if this helps.

Thanks
Nagarajan Ganesan
# 5  
Old 04-11-2007
Quote:
Originally Posted by zuberk
thanks but ive already done that to display messages on the screen, im looking for an option for the user to run my script and then add notes to it such as like a text box

for example

user has a menu

1.machine info
2.software info
3.network info

once the user has chosen the option the results are given and then if possible given a text box to enter notes

Code:
printf "%s\n" "Enter notes and press ^D to finish"
notes=$( cat )
printf "%s\n" "$notes" >> FILENAME

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Spooling File to My Desktop From Back-end using shell script

Hello all, I am trying to spool a SQL query output file from back-end to desktop in a certain path but it didn't work,the query writes the output in a file in the same directory at the back-end. note : i use the same query in sql developper and file was created in the desired path fine code... (1 Reply)
Discussion started by: bmaksoud
1 Replies

2. Shell Programming and Scripting

Script to add backslashes to end of certain lines of text

I'd like to write up notes in a relatively readable format and then use a shell script to add LaTeX formatting. Specifically, I'm trying to figure out how to add the LaTeX newline character (\\) to the end of lines without \begin{} or \end{} statements example notes file: \begin{enumerate} --... (2 Replies)
Discussion started by: icskittles
2 Replies

3. Shell Programming and Scripting

How to add trailer record at the end of the flat file in the unix ksh shell scripting?

Hi, How to add trailer record at the end of the flat file in the unix ksh shell scripting can you please let me know the procedure Regards Srikanth (3 Replies)
Discussion started by: srikanth_sagi
3 Replies

4. Shell Programming and Scripting

How does a shell script recognize the end of a line?

Hi friends , I want to know how does a shell script recognize the end of a line? . i have hunddres of proccedure to test where i want to ingnore the comments which starts with "--" .. it can start from the middle of the lines also. for example:: select * from table1; -- getting... (5 Replies)
Discussion started by: neelmani
5 Replies

5. Shell Programming and Scripting

Shell script menu for end user - difficult challenge

Hello, I need to make shell script menu for my end users. There is like 100 scripts in system, and they need to run that scripts true one main script with user friendly menu. Example, when user will run main menu script, it will get something like this on his screen:... (3 Replies)
Discussion started by: waso
3 Replies

6. Shell Programming and Scripting

Help with shell script: moving end of line character

Hello. I have a file (old.txt) that I need to copy into another file (new.txt). Each line on old.txt ends with CR/LF but the position of CR/LF varies from one record to another. I need to copy each line of record to new.txt and move CR/LF in pos 165. Can I use awk to achieve this? How?... (8 Replies)
Discussion started by: udelalv
8 Replies

7. UNIX for Dummies Questions & Answers

Shell Script to end process help

I'm trying to write shell script that when invoke, has 2 arguements, or 1. If there's one arguement, then that's the process name. If there's 2, then one is the timeout. USAGE: Assign1.sh <process> <timeout> If no timeout was set, then the default timeout is 15 minutes. So after it read the... (6 Replies)
Discussion started by: NoobieBoobie
6 Replies

8. Shell Programming and Scripting

add a line at the end of a file using shell scripting

Hi All , I am new to shell scripting. i have a shell script(which is executed as a super user) , i want to it to do one more job for me. ie mounting a directory over other using lofs . i have done it manually using 1) using mount command mount -F lofs /export/home/dju /dju 2)... (4 Replies)
Discussion started by: meet123321
4 Replies

9. Shell Programming and Scripting

end of file problem with shell script

My shell script was working ok with K shell. But all of sudden, it started acting crazy. it keeps saying this: syntax error at line 70 : `"' unmatched I don't even have 70 lines in my file or this : syntax error at line 69: `end of file' unexpected Can this file got... (5 Replies)
Discussion started by: whatisthis
5 Replies
Login or Register to Ask a Question