08-02-2014
groupdel (On Linux and some other UNIXES ) does not have a -g option. Your code is incurring an error and failing; note you are interpreting it as the 'group does not exist'.
Commands can fail dozens of ways. Read the info or man page for the allowed options for your flavor of UNIX. And trap all of the errors you can so your code is not misleading, simply say something like 'groupdel failed.' To do this you need to redirect stderr in your code to a variable or to stdout. In other words, display the error message groudel or goupadd emits.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
As part of a NIS implementation, (I think) I want to create a group (in /etc/group) that has users that do not exist on the target machine.
What effect will this have? Will it cause any problems?
Thanks,
Gary Cooper (1 Reply)
Discussion started by: Gary Cooper
1 Replies
2. UNIX for Advanced & Expert Users
I'm kinda new to unix programming so bear with me...
I'm running a script prompting a user for an existing user and group and want to be able to validate if they valid.
Is there any code available?
Any help or push in the right direction would help.
Thank you, (2 Replies)
Discussion started by: thedon
2 Replies
3. Shell Programming and Scripting
I have a script that is working:
#!/bin/bash
sftp user@domain.com <<EOF
cd somedir
mget *.csv
quit
EOF
but on a crontab I want to only pull newer files, so I want to do something like:
while read ls current dir local file != true do
mget that new file
but I'm not sure the syntax... (2 Replies)
Discussion started by: unclecameron
2 Replies
4. Shell Programming and Scripting
Hey People,
I've got a question! How can i write a function in a script which is looking for if a group exist and if not, that the group "users" is the standard group..I know that i have to use "grep" und "if-else"..I will be very happy for answers ;)
Greetz
Ali (2 Replies)
Discussion started by: AliC
2 Replies
5. Shell Programming and Scripting
Hello,
I want to run one (not multiple) action if an element doesn't exist in array.
for example:
@array = (1..10);
foreach $el (@array)
{
if ($el != 11)
{
print "number not found\n";
}
}
the output of this simple script:
number not found (3 Replies)
Discussion started by: ahmed_zaher
3 Replies
6. Programming
Hey,
I'm currently getting into some kernel module progamming. As a little exercise I want to read the headers out of an ELF file. My code is very simple, here is the important part:
struct file *fp;
/* ... */
fp = filp_open("some/file/on/my/pc", O_RDONLY, 0);
if(fp == NULL) {
... (15 Replies)
Discussion started by: disaster
15 Replies
7. UNIX for Dummies Questions & Answers
Hi there, normally if I want to remove a user tht I have added to a specific group, i would do the following
this is what my group2 looks like
# grep group2 /etc/group
group2:x:7777:user2,user1,user4
user1 has been defined in a few groups
# id -nG user1
group1 group2 group3
So... (3 Replies)
Discussion started by: rethink
3 Replies
8. Solaris
Hii all,
i create the user
useradd -d /home/kk kk
passwd kk
when i tried to login to kk
i get a error user directory doesn't exist
then i tried
useradd kkk
passwd kkkwhen i tried to login to kkk
i get the same error user directory doesn't exist. (4 Replies)
Discussion started by: vipinkumarr89
4 Replies
9. Red Hat
Our SAN administrator decided to unpresent then destroy LUN's we were actively using as a volume group (all PV's in said volume group). Now every time I do a pvscan or whatever it complains about I/O errors trying to access those PV's. How do I get it to forget the VG existed completely? vgreduce... (7 Replies)
Discussion started by: thmnetwork
7 Replies
10. Shell Programming and Scripting
Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom.
I create a named pipe then:
dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024
but when I cat a file to the fifo that's 1024 random bytes:
cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies
LEARN ABOUT DEBIAN
debconf-mergetemplate
DEBCONF-MERGETEMPLATE(1) Debconf DEBCONF-MERGETEMPLATE(1)
NAME
debconf-mergetemplate - merge together multiple debconf template files
SYNOPSIS
debconf-mergetemplate [options] [templates.ll ...] templates
DESCRIPTION
Note: This utility is deprecated. You should switch to using po-debconf's po2debconf program.
This program is useful if you have multiple debconf templates files which you want to merge together into one big file. All the specified
files will be read in, merged, and output to standard output.
This can be especially useful if you are dealing with translated template files. In this case, you might have your main template file, plus
several other files provided by the translators. These files will have translated fields in them, and maybe the translators left in the
english versions of the fields they translated, for their reference.
So, you want to merge together all the translated templates files with your main templates file. Any fields that are unique to the
translated files need to be added in to the correct templates, but any fields they have in common should be superseded by the fields in the
main file (which might be more up-to-date).
This program handles that case properly, just list each of the translated templates files, and then your main templates file last.
OPTIONS
--outdated
Merge in even outdated translations. The default is to drop them with a warning message.
--drop-old-templates
If a translation has an entire template that is not in the master file (and thus is probably an old template), drop that entire
template.
SEE ALSO
debconf-getlang(1)
AUTHOR
Joey Hess <joeyh@debian.org>
2012-09-10 DEBCONF-MERGETEMPLATE(1)