Search Results

Search: Posts Made By: ADay2Long
7,242
Posted By Corona688
"^${ACCNAME}:[^0-9a-zA-Z./\$]" ?
"^${ACCNAME}:[^0-9a-zA-Z./\$]" ?
1,878
Posted By agama
Something like this will stop when the user...
Something like this will stop when the user enters CTL-D and illustrates saving failed names:


list=""
while read username
do
list="$list,$username" # save list of names, introduces a...
1,878
Posted By Corona688
if [[ 'grep -c "$username" /etc/passwd' = "1" ]] ...
if [[ 'grep -c "$username" /etc/passwd' = "1" ]]

'grep -c "$username" /etc/passwd' will never equal "1", because it's a string, containing the letters grep -c "$username" /etc/passwd". ...
1,878
Posted By Chubler_XL
Corona688's grep -q solution is the best, but so...
Corona688's grep -q solution is the best, but so you understand how things work I'll try and explain how one gets to it.

1. call grep, and throw away it's output and then examine return...
Showing results 1 to 4 of 4

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