Sponsored Content
Top Forums Shell Programming and Scripting How can I parse a record found in /etc/passwd into variables? Post 302151754 by shew01 on Monday 17th of December 2007 07:35:42 AM
Old 12-17-2007
Quote:
Originally Posted by prowla
This should work:

Code:
grep "^oracle:" /etc/passwd | read s
USER=`echo $s | cut -d: -f1`
LOGNAME=$USER
HOME=`echo $s | cut -d: -f6`

Thanks! This works great!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I parse passwords into passwd command.

Do you know of any methods where I can send an input of passwords into the passwd command? For instance, I have a file which has the password stored and I want it to be sent into this command "passwd gilberteu" when it prompts for the new password and subsequently confirming the password that was... (0 Replies)
Discussion started by: gilberteu
0 Replies

2. Shell Programming and Scripting

How to parse a string into variables

I'm working in korn shell and have a variable which contains a string like: aa_yyyymmdd_bbb_ccc_ddd.abc. I want to treat the _ and . as delimiters and parse the string so I end up with 6 values in variables that I can manipulate. My original plan was to use var1=`echo $sting1 | cut -c1-c2` but... (9 Replies)
Discussion started by: aquimby
9 Replies

3. Shell Programming and Scripting

Bash Script to read a file and parse each record

Hi Guys, I am new to unix scripting and I am tasked to parse through a CSV file delimited by #. Sample: sample.csv H#A#B#C D#A#B#C T#A#B#C H = Header D = Detail Record T = Tail What I need is to read the file and parse through it to get the columns. I have no idea on how... (8 Replies)
Discussion started by: 3vilwyatt
8 Replies

4. Shell Programming and Scripting

Want to parse output for variables in Bash

Trying to finish up my script that automates some video encoding work. Situation: There is an MKV file to be transcoded. Problem: MKVINFO will give a bunch of output about an MKV file, included in that output are two lines I am interested in: | + Default duration: 41.708ms (23.976 fps... (9 Replies)
Discussion started by: randyharris
9 Replies

5. UNIX for Dummies Questions & Answers

Parse or cut concat variables to individual values

Hello I need to pass some environment parameters to a datastage job and am getting an error when trying to send the complete concatinated variable. I have decided to parse out just the values and send as parameters but am struggling to find the best way to do this (actually I am not very... (3 Replies)
Discussion started by: LynnC
3 Replies

6. Shell Programming and Scripting

prompt to delete each record when pattern is found

Hello!. I am working on a very simple program and I have been trying different things. This is so far what I have done and there is one small detail that still does not work. It finds all the records in a phonebook per say: ./rem Susan More than one match; Please select the one to remove: ... (3 Replies)
Discussion started by: bartsimpsong
3 Replies

7. Shell Programming and Scripting

Cut fields from /etc/passwd file into variables?

The script must ask the user to enter the user name and check whether the user exists in /etc/passwd (you must allow the partial usernames also). If the username exists, display the details as: List of users Login Name: User ID: ... (3 Replies)
Discussion started by: nobletechnology
3 Replies

8. Linux

Parse ; deliminated variable to create variables

Hi there, would appreciate some help on this parsing problem if anybody can help im trying to parse a variable with the following output, each of the values im trying to parse are deliminated by a ; T192... (8 Replies)
Discussion started by: scottish_jason
8 Replies

9. Shell Programming and Scripting

Parse variables from C++ to shell

Hi All, #include <iostream> int main() { std::int foo = 34; system("mkdir /home/linuxUser/fooDir"); system("vi fooFile") system("write foo in fooFile") foo = 43; foo = read foo from fooFile; std::cout << "foo = " << foo ; } result should be foo = 34 can... (3 Replies)
Discussion started by: linuxUser_
3 Replies

10. Shell Programming and Scripting

Delete only if duplicates found in each record

Hi, i have another problem. I have been trying to solve it by myself but failed. inputfile ;; ID T08578 NAME T08578 SBASE 30696 EBASE 32083 TYPE P func just test func chronology func cholesterol func null INT 30765-37333 INT 37154-37318 Link 5546 Link 8142 (4 Replies)
Discussion started by: redse171
4 Replies
ICECREAM(1)						      Icecream User's Manual						       ICECREAM(1)

NAME
scheduler - Icecream scheduler SYNOPSIS
scheduler [-n | --netname name] [-p | --port port] [-h | --help] [-l | --log-file file] [-d | --daemonize] [-r | --allow-run-as-user] [-v [v [v]]] DESCRIPTION
The Icecream scheduler is the central instance of an Icecream compile network. It distributes the compile jobs and provides the data for the monitors. OPTIONS
-n, --netname netname The name of the Icecream network the scheduler controls. -p, --port port IP port the scheduler uses. -h, --help Print help message. -l, --log-file logfile Name of file where log output is written to. -d, --daemonize Detach daemon from shell. -v, -vv, -vvv Control verbosity of daemon. The more v the more verbose. -r, --allow-run-as-user Force running the scheduler with user rights. Usually you will need to run the scheduler with root rights. SEE ALSO
icecream, scheduler, iceccd, icemon AUTHOR
Cornelius Schumacher Icecream April 21th, 2005 ICECREAM(1)
All times are GMT -4. The time now is 02:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy