Sponsored Content
Top Forums Shell Programming and Scripting Script to run #groups command on list in a file Post 303036486 by Kentlee65 on Friday 28th of June 2019 12:09:23 PM
Old 06-28-2019
That still doesn't run correctly. Here is the output (edited for security):

Code:
<me> :~> ls -l
total 36
drwxr-xr-x 2 <me>  users 4096 Dec  3  2018 bin
-rw-r----- 1 <me>  users   34 Jun 28 09:14 (hostname)_unlist.txt
-rw-r----- 1 <me>  users  109 Jun 28 09:12 (hostname)_userlist.txt
-rwxr----- 1 <me>  users  207 Jun 28 11:00 groups.sh
-rw-r----- 1 <me>  users  145 Apr 25 09:02 hello.h
-rw-r----- 1 <me>  users  254 Apr 26 13:37 intro
-rw-r----- 1 <me>  users  234 Dec 28 09:16 SLES.txt
-rw-r----- 1 <me>  users    0 Jan 17 15:34 su
-rw-r----- 1 <me>  users   78 Dec 28 11:05 testsles.txt
-rw-r----- 1 <me>  users  216 Jun 28 09:08 unlist.txt
x:~> groups
users
x:~> ls -l
total 36
drwxr-xr-x 2 <me>  users 4096 Dec  3  2018 bin
-rw-r----- 1 <me>  users   34 Jun 28 09:14 (hostname)_unlist.txt
-rw-r----- 1 <me>  users  109 Jun 28 09:12 (hostname)_userlist.txt
-rwxr----- 1 <me> users  207 Jun 28 11:00 groups.sh
-rw-r----- 1 <me>  users  145 Apr 25 09:02 hello.h
-rw-r----- 1 <me>  users  254 Apr 26 13:37 intro
-rw-r----- 1 <me>  users  234 Dec 28 09:16 SLES.txt
-rw-r----- 1 <me>  users    0 Jan 17 15:34 su
-rw-r----- 1 <me>  users   78 Dec 28 11:05 testsles.txt
-rw-r----- 1 <me>  users  216 Jun 28 09:08 unlist.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to run shell command and insert results to existing xml file

Hi. Thanks for any help with this. I'm not new to programming but I am new to shell programming. I need a script that will 1. execute 'df -k' and return the volume names with specific text 2. surround each line of the above results in opening and closing xml tags 3. insert the results of step... (5 Replies)
Discussion started by: littlejon
5 Replies

2. Shell Programming and Scripting

Run SQL command for a list of devices

Hi Please help me to resolve. Question: I can run this command to change the mode of a device with id=500 as below dbc "select device mode=3 where id=500;" How can i run the same query with a file contaning n number of ids ? file1.txt 12 234 34 500 34 45 Thanks in... (3 Replies)
Discussion started by: sureshcisco
3 Replies

3. Shell Programming and Scripting

Script to run command against multiple specific value in one file

Hi all, I am trying to create a shell script from solaris 10 server to run a command into multiple specific value in one file. The command is related to Oracle/Sun JES2005Q4 directory server. #this is the command, #from path /jes/ds/slapd-rldap1 ./ns-inactivate.pl -h mldap1 -p 389 -D... (12 Replies)
Discussion started by: Mr_47
12 Replies

4. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

5. Shell Programming and Scripting

Urgent...Need a shell script to list files which belong to particular groups

Hi, I am just new to scripting but got to write a complex scipt please help. i need a shell script which can check the list of data listed in a txt doc and see if they belong to any of the groups that are listed in other list file.... (5 Replies)
Discussion started by: draghun9
5 Replies

6. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

7. UNIX for Dummies Questions & Answers

Read workstation list from file und run command

Hi, how do I read in a file which includes a list of workstations and then run a command for each workstation ? I am unclear which command to use to read in , or is this not possible ? Thanks, (3 Replies)
Discussion started by: manni2
3 Replies

8. Shell Programming and Scripting

Script to read through a file and create new users/assign them to groups in Ubuntu

Hi all. I need a shell script that can, in short, read through a text file line by line and create a new user in Ubuntu, as well as assign that user to a group. The format of the text file is not important but preferably: 'username:group'. I don't have much programming knowledge no matter shell... (3 Replies)
Discussion started by: LewisWeekly
3 Replies

9. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

10. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies
creatbyproc.d(1m)						   USER COMMANDS						 creatbyproc.d(1m)

NAME
creatbyproc.d - snoop creat()s by process name. Uses DTrace. SYNOPSIS
creatbyproc.d DESCRIPTION
creatbyproc.d is a DTrace OneLiner to print file creations as it occurs, including the name of the process calling the open. This matches file creates from the creat() system call; not all file creation occurs in this way, sometimes it is through open() with a O_CREAT flag, this script will not monitor that activity. Docs/oneliners.txt and Docs/Examples/oneliners_examples.txt in the DTraceToolkit contain this as a oneliner that can be cut-n-paste to run. Since this uses DTrace, only users with root privileges can run this command. EXAMPLES
This prints process names and new pathnames until Ctrl-C is hit. # creatbyproc.d FIELDS
CPU The CPU that recieved the event ID A DTrace probe ID for the event FUNCTION:NAME The DTrace probe name for the event remaining fields The first is the name of the process, the second is the file pathname. DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
creatbyproc.d will run forever until Ctrl-C is hit. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
dtrace(1M) version 1.00 Jun 11, 2005 creatbyproc.d(1m)
All times are GMT -4. The time now is 08:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy