Search Results

Search: Posts Made By: austinharris43
Forum: Red Hat 03-24-2011
6,970
Posted By austinharris43
The only code in this script is: START: ...
The only code in this script is:

START:
@testing = `awk -F: '{if (\$7 =="") {print \$1}}' /etc/passwd`;
if ($testing [0] =~ m/[[:print:]]/)
{
system ("chsh -s /sbin/nologin $testing[0]...
Forum: Red Hat 03-24-2011
6,970
Posted By austinharris43
Well...say the account having its shell changed...
Well...say the account having its shell changed is 'news'.

I get the output of.
Forum: Red Hat 03-24-2011
6,970
Posted By austinharris43
perl backticks: can't redirect output.
Hi everyone. This is a bit of a perl/linux mixed question. I am trying to redirect STDOUT of chsh by using the following line of perl code.

system ("chsh -s /sbin/nologin $testing[0]...
Forum: Red Hat 03-21-2011
3,899
Posted By austinharris43
Redirect STDOUT and STDERR of chsh
EDIT: Nevermind, figured it out! Forgot to put backslashes in my perl script to not process literals!

Hi everyone. I am trying to have this command pass silently. (no output)
chsh -s /bin/sh...
Forum: Red Hat 03-08-2011
2,618
Posted By austinharris43
Well I mean after it changes the blank line to...
Well I mean after it changes the blank line to /sbin/nologin...I tried your code


awk -F: '!$7{print "/sbin/nologin"}' /etc/passwd


and it echoed "/sbin/nologin" but it didn't actually change...
Forum: Red Hat 03-08-2011
2,618
Posted By austinharris43
These are great everyone. Is there a way to make...
These are great everyone. Is there a way to make it only verbose?

---------- Post updated at 11:36 AM ---------- Previous update was at 11:15 AM ----------



This one works best, is there a...
Forum: Red Hat 03-08-2011
2,618
Posted By austinharris43
awk question
Hi everyone. I have a quesiton about awk. I am running the following line of code under bash.

awk -F: '{print $7}' /etc/passwd

When I run that it returns the list of each shell for each...
Forum: Red Hat 03-02-2011
1,314
Posted By austinharris43
List shell of specific account
Hi everyone. I am wondering how I would accomplish outputting the shell of a specific account on a single line of output. For example I would like to list the shell of 'news' as...

/bin/sh
...
Forum: Red Hat 02-10-2011
2,073
Posted By austinharris43
I said I already tried that, but thanks...I...
I said I already tried that, but thanks...I figured out a better way to accomplish what I need.

/thread
Forum: Red Hat 02-10-2011
2,073
Posted By austinharris43
Make STDERR readable as STDOUT
Hi all. I am trying to use backticks in Perl to put STDERR into a string. The code is...

$readkey_test = `perl -MTerm::ReadKey -e 1`;
print $readkey_test;

if ($readkey_test =~ m/[[:print]]/)...
Forum: Red Hat 02-03-2011
3,081
Posted By austinharris43
Ah thanks, I'll just use -maxdepth 1 to get files...
Ah thanks, I'll just use -maxdepth 1 to get files only immediately under it.
Forum: Red Hat 02-03-2011
3,081
Posted By austinharris43
chmod only immediate directory?
I am having trouble figuring out how to do a "chmod o-w" for all files under a certain directory, while excluding directories under that certain directory.

I can do

chmod -R o-w...
Forum: Red Hat 01-06-2011
1,144
Posted By austinharris43
Works like a charm, thanks!
Works like a charm, thanks!
Forum: Red Hat 01-06-2011
1,144
Posted By austinharris43
Problem using awk
Hello. I am trying to use awk as follows:
chsh -s /bin/sh news | awk '{print $5}'

However it still gives me the full output of:
chsh: user "news" does not exist.

I want to just pull "not"...
Forum: Red Hat 01-04-2011
5,570
Posted By austinharris43
This works perfectly, thanks!
This works perfectly, thanks!
Forum: Red Hat 01-04-2011
5,570
Posted By austinharris43
That's sort of what I want...but I need the last...
That's sort of what I want...but I need the last part of it by itself, and I don't think awk will work here because there are no spaces. There's no way to do kind of like this?


echo $SHELL

...
Forum: Red Hat 01-04-2011
5,570
Posted By austinharris43
How to list shell of account?
Hello. I have been trying to figure out something very simple that I know I've done before; which is list the shell of a specific account. In this case it is the account: "news". I know how to...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy