Sponsored Content
Top Forums Shell Programming and Scripting Check if passed arguments is users Post 302465851 by testman84 on Sunday 24th of October 2010 03:45:11 PM
Old 10-24-2010
the input will be by user like " user1 user2 anytext "
and the out put must be like
"user1 is user "
"user2 is user "
"anytext not a user"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check if argument passed is an integers

How do I check if the argument passed to a script is an integer? I am writting a script that will take to integers and want to be able to check before I go on. I am using bourne shell. Thanks in advance (13 Replies)
Discussion started by: elchalateco
13 Replies

2. Shell Programming and Scripting

count no of arguments passed to a function

hi i have a function abc { //from this function i am passing args to antoher function like def a b c j k l } now i want to count the no of args coming to def() function and iterate over those values is there any way to do this one please help (2 Replies)
Discussion started by: satish@123
2 Replies

3. Shell Programming and Scripting

How to check that passed parameters all have the same extension?

$ ls monkey.txt banana.csv tree.txt $ myscript monkey.txt tree.txt All extensions ARE alike. $ myscript *txt All extensions ARE alike. $ myscript monkey.txt banana.csv All extensions are NOT alike. $ myscript * All extensions are NOT alike. My brain has given up; what's the simplest... (11 Replies)
Discussion started by: cs03dmj
11 Replies

4. Shell Programming and Scripting

How to pass arguments to SQL file passed in shell script?

Hi, I am using SYBASE database. in my script i am connecting to DB via using isql. isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 Replies

5. Red Hat

how can i know what arguments are passed to a pre install rpm script?

hi, i have an rpm, and i am looking at the presinstall script. i can see it takes in an argument, but what i do not know is how this argument is passed to the script? is there something that calls the preinstall script? i thought the preinstall script was the first thing executed. thanks (2 Replies)
Discussion started by: JamesByars
2 Replies

6. UNIX for Advanced & Expert Users

Function not called when no arguments is passed

Hi Guys, I am trying to pass arguments to the script i am wrinting. When no argument is passed or wrong argument is passed, the script needs to output the way it needs to be called and exit. Currently, when no arguments is passed, it is not getting exited but goes on assuming those... (3 Replies)
Discussion started by: mac4rfree
3 Replies

7. Shell Programming and Scripting

Store all the passed arguments in an array and display the array

Hi I want to write a script which store all the parameters passed to the script into an array. Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD. I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies

8. Shell Programming and Scripting

Deleting columns passed as arguments to the script

Hi all, I am trying to delete columns in a file using a script. The columns that need to be deleted are passed as arguments to the script. The script should look like this > delete_columns.sh <file_name.txt> <column_numbers_to_be_deleted> The contents of the file_name.txt will be like ... (5 Replies)
Discussion started by: VNR
5 Replies

9. Shell Programming and Scripting

Shell script that check the argument passed to it and prints error if test condition is not met

I want to make a script that check for the argument passed to it and generates an error in case any character/string argument passed to it. I am using below code, but its not working. can anyone help. #!/bin/bash if ]; then echo 'An integer argument is passed to the script hence... (3 Replies)
Discussion started by: mukulverma2408
3 Replies

10. Shell Programming and Scripting

How can multiple arguments be passed to shell script?

My requirement is that I want to pass similar argument to a shell script and process it in the script. Something like below: myScript.sh -c COMPONENT1 -c COMPONENT2 -a APPNote: -c option can be specified multiple times and -a is optional parameter I know this can be achieved using... (2 Replies)
Discussion started by: rajdeep_paul
2 Replies
FOOMATIC-PRINTJOB(1)					      General Commands Manual					      FOOMATIC-PRINTJOB(1)

NAME
foomatic-printjob - <put a short description here> SYNOPSIS
foomatic-printjob [ -s spooler ] [ -P queuename ] [ -o option1=value1 -o option2 ... ] [ -i ] [ file1 file2 ... ] foomatic-printjob -Q [ -s spooler ] [ -P queuename ] [ -i ] [ -a ] [ user1 user2 ... ] foomatic-printjob -R [ -s spooler ] [ -P queuename ] [ - ] [ -i ] [ jobid1 jobid2 ... ] foomatic-printjob -C [ -s spooler ] [ -i ] command [ arguments ] foomatic-printjob -S [ -s spooler ] [ -i ] foomatic-printjob -h [ -s spooler ] [ -P queuename ] [ -i ] Options -sspooler Explicit spooler type (cups,lpd,lprng,pdq) -Pqueuename Command should apply to this queue -ooption=value Set option to value -ooption Set the switch option -#n Print n copies file1 file2 ... Files to be printed, when no file is given, standard input will be printed -Q Query the jobs in a queue -a Query the jobs in all queues user1 user2 ... Users whose jobs should be listed -R Remove a job from a queue - Remove all your jobs jobid1 jobid2 IDs of the jobs to be removed -C Execute control commands for queue/job manipulation command [ arguments ] Control command for queue/job manipulation. The commands are the ones of the BSD "lpc" utility. Use the control command "help" to get a list of supported commands. Note: the amount of commands varies with the spooler, but the same commands given under differ- ent spoolers do the same thing. -i Interactive mode: You will be asked if foomatic-printjob is in doubt about something. Otherwise foomatic-printjob uses auto- detection or quits with an error. -S Save the chosen spooler as the default spooler -h Show this message or show a list of available options if a queue is specified EXIT STATUS
foomatic-printjob returns ... AUTHOR
Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> for the foomatic project using output from the associated binary. BUGS
This manpage needs some editing. Foomatic Project 2001-01-06 FOOMATIC-PRINTJOB(1)
All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy