how to write shell prog


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to write shell prog
# 1  
Old 04-24-2002
Question how to write shell prog

how to write shell program. EX : to check whether a string is a palindrome or not.
# 2  
Old 04-24-2002
You may try it on C program. Here is a code that checks whther the string is palindrome or not in C.

Code:
main(c,v)
char**v;
{
	char*p;
	for(c>1?p=strchr(*++v,0):exit(1);*(*v)++==*--p&&*v<p||exit(puts(*v<p?"n":"y")-2) ; ) ;
}

# 3  
Old 04-26-2002
Dear Killer,

You fell for it, head over heels.

Another homework question!!! ie. 1st post, general question content. Someone the other day was looking for a script for this same purpose. Here is that one...

https://www.unix.com/showthread.php?s...ght=palindrome

I know we are eager to help everyone on this site with their problems and questions, but please discourage them Killerserv... Or at least make them work for the answer... Smilie

"Laxity breeds contempt... Perseverance breeds awareness..."



I wish I could close this post, but I will have to leave that to a moderator. Could someone help me out with this request?


This is not a demand, but a humble request. I would like to become a moderator. I think that I have what it takes... Can someone put in a good word for me with Neo???Smilie

Thanks.
# 4  
Old 04-28-2002
Acknowledged Kelam. Never knew it would content a Homework quesition.
# 5  
Old 04-30-2002
Quote:
Originally posted by killerserv
Acknowledged Kelam. Never knew it would content a Homework quesition.
Actually, I thought you replied to a homework question with an answer that no first year CS student would be able to explain to an instructor. I thought it was quite a subtle response...
# 6  
Old 03-17-2006
question

after this thread i have a question, why would you discourage someone? or close this post? is there some sort of occult knowledge that only few are privy to ? why would you not help someone seeking an answer?



vyrus
# 7  
Old 03-17-2006
Quote:
Originally Posted by vyrus
after this thread i have a question, why would you discourage someone? or close this post? is there some sort of occult knowledge that only few are privy to ? why would you not help someone seeking an answer?

vyrus
It is not this forum's intention to discourage anyone from seeking help. However, if you go through this thread, you probably will see how most non school/college guys feel about homework postings.

To sum it up, you are not going to learn anything by getting someone else to do your homework for you. However, if you have put together a solution yourself that just falls short of the requirement, you will find that quite a few guys are willing to help you with that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issues while trying to run a shell script using the command sh <filename.prog>

Hi, I'm facing issues while trying to run a sample program on Linux. If I try to run the script using the command "sh <filename.prog>", it doesn't work. But, if I try to execute it using the command "ksh <filename.prog>", it works fine. Even ". ./filename.prog" works fine. Can you... (6 Replies)
Discussion started by: venkatesh17
6 Replies

2. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

3. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

4. Shell Programming and Scripting

shell prog for double words

I need a shell programing script for "double words" Available Data: This is a shell script that is used to find the ten character words in the machine local dictionary (/usr/dict/words) that are made up with two valid english words that are five character long. This means that each of the... (0 Replies)
Discussion started by: sujithcrazy
0 Replies

5. Shell Programming and Scripting

How to write the shell using c

Hi, guys: I am working on my own shell using c. When I fork a child process and make it run in background. I hope when this process exits, my shell can print a line such as "this process exits". Does anyone know how to implement it? Thanks (5 Replies)
Discussion started by: tomlee
5 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. Shell Programming and Scripting

Need to Write Shell Script based off of this shell command

I'm trying to read a bunch of log files and output the lines that contain particular strings. To accomplish this, I've been running the following from the command line: find . -name "*" | xargs grep " " | grep " " > output.txt Two grep statements are needed in case I'm looking for a... (3 Replies)
Discussion started by: Rally_Point
3 Replies

8. Shell Programming and Scripting

how to call java prog from shell script

I have a java program to validate a XML file. I want to call this java program in a shell script which will be registered as concurrent program in oracle apps. Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps... (1 Reply)
Discussion started by: kcp_pavan
1 Replies

9. Programming

how to write a prog to check a no falls in febonacii series or not

hi, how to write a prog to check a no falls in febonacii series or not (2 Replies)
Discussion started by: useless79
2 Replies

10. Shell Programming and Scripting

shell script prog help

How to write a program to store the list of ordinary files and the directory files in the specified directory in two files called dir.dat and ord.dat. Then print the largest directory and largest file? (1 Reply)
Discussion started by: rameshparsa
1 Replies
Login or Register to Ask a Question