Creating functions in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating functions in shell script
# 1  
Old 05-10-2008
Creating functions in shell script

hi friends,

I am working with shell commands and all these works properly.
Then i created a small function which includes these commands.

Now the problem arises. When the commands are run by calling this fuction.it
shows error.
Why i am not able to run the unix command inside a function.
Please note i am not working as an user.
the main commands i use are awk,cp,date etc

Please help
# 2  
Old 05-10-2008
no double posting. read the rules. thread closed!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to find C programming functions using shell script?

I want to find c function definition with pattern with shell script by checking condition for each line: data_type functionname(param_list){ .... } I knew cscope or ctag is usable for this task, but if there any ways to do without using them. I am thinking of checking line condition... (3 Replies)
Discussion started by: cmdcmd
3 Replies

2. Shell Programming and Scripting

Shell script to apply functions to multiple columns dynamically

Hello, I have a requirement to apply hashing algorithm on flat file on one or more columns dynamically based on header sample input file ID|NAME|AGE|GENDER 10|ABC|30|M 20|DEF|20|F say if i want multiple columns based on the header example id,name or id,age or name,gender and hash and... (13 Replies)
Discussion started by: mkathi
13 Replies

3. Shell Programming and Scripting

Creating IN list in PLSQL script dynamically by using shell script

Hi all, I have a PLSQL script which has a IN list where it takes some ids as input. For example SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID IN (comma separated list ) I want to run this quest inside a shell script but I would like to prepare the IN list dynamically where the employee ids... (1 Reply)
Discussion started by: LoneRanger
1 Replies

4. Shell Programming and Scripting

Functions in a shell script

so i have a very big script that has the following format: functionA () { .... ... .... } Results=$(functionA) the code inside of functionA is very huge. so by the time the script gets to the "Results=" part, several seconds have already passed. the script is about 15MB in size.... (4 Replies)
Discussion started by: SkySmart
4 Replies

5. Shell Programming and Scripting

using library functions in shell script

hey guys, i made up a library file called common.lib so as to reuse the same code without typing it again. here is the code. its pretty basic . ## This is the second function compare() { file1 = $1 file2 = $2 cmp $file1 $file2 if then echo "comparison is possible"... (1 Reply)
Discussion started by: Irishboy24
1 Replies

6. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

7. Shell Programming and Scripting

Calling shell functions from another shell script

Hi, I have a query .. i have 2 scripts say 1.sh and 2.sh 1.sh contains many functions written using shell scripts. 2.sh is a script which needs to call the functions definded in 1.sh function calls are with arguments. Can some one tell me how to call the functions from 2.sh? Thanks in... (6 Replies)
Discussion started by: jisha
6 Replies

8. Shell Programming and Scripting

Shell script functions

Simple shell script : date test_fn() { echo "function within test shell script " } on the shell prompt I run > . test Then I invoke the function on the command line as below : test_fn() It echos the line function within test shell script and works as expected. ... (5 Replies)
Discussion started by: r_subrahmanian
5 Replies

9. Shell Programming and Scripting

Creating my first Shell Script

I have an assignment in my programming class to write a shell script that will use command line parameters, display the # of parameters, display all parameters on the command line and display the parameters $0-$9. I understand some of the code (I will be using 'n' to represent the count through... (1 Reply)
Discussion started by: plmahan
1 Replies

10. Shell Programming and Scripting

help on creating shell script

Can some one smart here help I need to create a shell script that does this below using vi editor. decrypts a file (specified as an argument to the script) containing text which was encrypted using the ROT-13 algorithm. The decrypted text should be written to a new file leaving the input file... (1 Reply)
Discussion started by: master_6ez
1 Replies
Login or Register to Ask a Question