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
help(1) 						      General Commands Manual							   help(1)

NAME
help - Provides information for new users SYNOPSIS
help DESCRIPTION
The help command presents a one-page display of information for new users. Information is available for the following topics: Concatenat- ing or displaying files Editing lines interactively Sending and receiving mail Reading system messages Changing password file information Identifying current users of the system Sending messages to the other users on the system Displaying the contents of directories Viewing information on the Source Code Control System Setting terminal modes SEE ALSO
Commands: cat(1), ex(1), finger(1), ls(1), mail(1), mailx(1), passwd(1), sccshelp(1), tset(1), who(1), write(1) help(1)
All times are GMT -4. The time now is 11:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy