function from shell input


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting function from shell input
# 1  
Old 02-22-2011
function from shell input

Hi all

i have the command called printer which needs a usernmae for example i would run the commnad

printer <username>

how can i write i quick script in perl that if the username is ab then write "denined" and if it is anything else it will work

thanks

Adam
# 2  
Old 02-23-2011
Can you try the code which you ve tried...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to iterate a function untill last argument with any order of input?

HI I need to get the function "kick" to get executed in any way the parameters are passed in to the function. The parameters are first stored in a dictionary self.otherlist = {} print self.otherlist self.populateTestList(self.system_type) print... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

2. Shell Programming and Scripting

Execute function as soon as input is provided in menu drive shell script

Hi All, I have a menu driven scripts. As you know while running the script we have to input the option such as 1,2, and 3 to execute function accordingly. but after selecting the input we have to press Enter. My requirement is to execute function as soon as we press the option. Is there... (5 Replies)
Discussion started by: kiran_j
5 Replies

3. UNIX for Dummies Questions & Answers

Passing Input To Function

May i please know why is it printing the script name for $0 when i pass those parameters to function. #!/bin/bash -x usage() { echo "In Usage Function" echo $0 echo $1 echo $2 } echo "printing first time" echo $0 echo $1 echo $2 usage $0 $1 $2 Output: (2 Replies)
Discussion started by: Ariean
2 Replies

4. UNIX for Dummies Questions & Answers

apply a function twice successively with the same input in awk program

Hi ! It is a general question. When an awk script looks like: #! bin/awk function example(i){ <body> } { example(1) #the function uses input_1 and return output_a } { example(2) #the function uses previous output_a as an input and returns... (15 Replies)
Discussion started by: beca123456
15 Replies

5. Shell Programming and Scripting

function terminating if i give input as space or no input and enter

HI i have written a script to ask input from the user. this script should promote the user for y/n input. if user enters anyother input then y/n the script promotes him again. this below code is working fine for all the cases. except for space and enter " if i give space and enter it is... (2 Replies)
Discussion started by: BHASKARREDDY006
2 Replies

6. Shell Programming and Scripting

Input handling and formatting input to shell

i want to get input and depending on it create new commands for input to expect. But problem is that after giving date or month as 01-09 it is interpretation as 1-9 echo -n "ENTER DATE " read d1 echo -n "ENTER MONTH " read m1 echo -n "ENTER YEAR" read y1 o=1 i=1 d2=`expr $d1... (1 Reply)
Discussion started by: sagar_1986
1 Replies

7. Shell Programming and Scripting

Split function input and output order

Dear Forum I'm Trying to use split function to split a string, but the output is not as the same order as of the string, please see simple example echo " " | nawk -v var="First;Second;Third;Fourth" ' BEGIN {split(var, arr,";") for(i in arr){print arr }}' The output is Second Third... (6 Replies)
Discussion started by: yahyaaa
6 Replies

8. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

9. UNIX for Advanced & Expert Users

conversion of a input function to i18n

m using unix c with curses im trying out the conversion of an existing code in c to i18n for the japanese language. the problem is that, the input which is given as the japanese characters is not taken correctly. and what it outputs is question marks(i.e. ???), equivalent to the number o f... (4 Replies)
Discussion started by: nirnay_s
4 Replies

10. Shell Programming and Scripting

awk - input function

hello, im a newbie. how can i input data from keyboard? thanks. (3 Replies)
Discussion started by: Jariya
3 Replies
Login or Register to Ask a Question