Shell Parameter...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Parameter...
# 1  
Old 12-06-2007
Shell Parameter...

I am trying to get the value of the user id (uid), which is the shell parameter.Then, read the /etc/passwd and keep the lines where the uid is superior to the parameter and write this line in a new file. But I am not getting what I wanted. Perhaps there is a problem with the Syntax below :-

#!/usr/bin/ksh
uid=${uid:-/etc/passwd}
/etc/passwd/read
$ cut -d: -f1 < uid gt $$

Can anyone help me, please.

Thanks,
Marconi.
# 2  
Old 12-07-2007
is this what you are trying to do?
Code:
grep $UID /etc/passwd

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Get Parameter with Shell request

How can I get Parameters with Shell Request. I mean so but not work: PHP: error_reporting(E_ALL); $hallo ="Hallo Welt"; print_r(shell_exec("sh client.sh $hallo")); Shell: echo $hallo echo ceck (5 Replies)
Discussion started by: Linuxmann
5 Replies

2. Shell Programming and Scripting

Passing a command shell parameter to another shell

Good afternoon, i need your help pls I want to write a new script that start running as soon as a previus one finish via Autosys (it should be implemented via Autosys too to validate the exsitance and the successful transfered file to a remote server Whenever the file arrives to the path... (2 Replies)
Discussion started by: alexcol
2 Replies

3. Fedora

Shell parameter definition

Hi Folks, I have a script called program.sh which was written by someone. I am supposed to edit it for my necessities. There is a line in the script that is as follows if ]; then echo -e "Option limit should be positive number and less than 1. Program aborts!" exit 1 ... (27 Replies)
Discussion started by: jacobs.smith
27 Replies

4. Shell Programming and Scripting

Script Shell Parameter

Hi I have two shell script, the second script takes as a parameter the output variable of the first script, please how to retrieve the variable from the first script to pass as a parameter to the second script? Script1.sh i=0 i=$(($i + 1)) Script2.sh echo $1 Thank you (0 Replies)
Discussion started by: chercheur111
0 Replies

5. Shell Programming and Scripting

parameter value change in shell script

How can i chnage the parameter value in shell script. file name is icare_mmi_cls.com, inside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com. can you please provide me with examples. Thanks Double post - check your PMs and follow the rules, thanks. (0 Replies)
Discussion started by: damodarreddys
0 Replies

6. Shell Programming and Scripting

simple shell - how to get a parameter typed in a shell script

Hi, I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies

7. Shell Programming and Scripting

replacing parameter in shell script

I have a script file as below named test1.sh sed -e 's/xxxkeys/$1/g' template1.asp > template1.txt sed -e 's/xxxkeys/$2/g' template2.asp > template2.txt sed -e 's/xxxkeys/$3/g' template3.asp > template3.txt sed -e 's/xxxkeys/$4/g' template4.asp > template4.txt I want to replace $1 with a,... (1 Reply)
Discussion started by: satgur
1 Replies

8. UNIX for Dummies Questions & Answers

Shell script with input parameter

Can anyone help me how to write a shell script which accepts input parameter. My requirement is as follows: I need to run a shell script with a input parameter, and inside the script i will create a file with this input parameter name. Please help me out to create such a shell script. ... (1 Reply)
Discussion started by: jhmr7
1 Replies

9. Shell Programming and Scripting

parameter file for a shell script

Hi I was able to pass parameters to a shell script from the command line but now, I am trying to make the shell script to get those parameters/values from a file. Please give me ideas how to do this or if you have an example or website that shows how to do this. I tried searches but it... (2 Replies)
Discussion started by: bryan
2 Replies

10. Shell Programming and Scripting

Shell parameter existence

Hello You know how to ask for the existence of one parameter and depending about it then do something, example: Original script: ################### USER=$1 PASS=$2 program1 $USER $PASS ################### Desired shell ################### USER=$1 PASS=$2 ARCH=$3 if then ... (3 Replies)
Discussion started by: osymad
3 Replies
Login or Register to Ask a Question