Search Results

Search: Posts Made By: woodson2
2,376
Posted By woodson2
Bash read input in case statement not working as expected
I'm having an issue with bash read input when using a case statement.

The script halts and doesn't read the input on the first loop. if I hit enter then the scripts starts to respond as expected....
4,033
Posted By woodson2
Thanks again!!
Thanks again!!
4,033
Posted By woodson2
Perfect...Thank you. ---------- Post updated...
Perfect...Thank you.

---------- Post updated at 11:40 PM ---------- Previous update was at 09:12 PM ----------

One more issue I'm encountering is trying to limit the regex a bit more.

I want...
4,033
Posted By woodson2
Require input in bash dialog box
Hello.

Any help would be greatly appreciated.

Right now I have the following input box that works fine and well, however I would like to wrap this is a loop that requires input. Right now the...
1,340
Posted By woodson2
So simple..Thanks. ---------- Post updated...
So simple..Thanks.

---------- Post updated at 04:04 PM ---------- Previous update was at 04:03 PM ----------



Thanks, I'll give this a try as well.
1,340
Posted By woodson2
Infinite "while" loop subshell loses current date variable
I have a simple script to log network connectivity to a set of systems.

However, as expected the date appended to the log never changes because the new variable is lost when the loop starts again....
1,376
Posted By woodson2
Thanks again as this snippet got me on the right...
Thanks again as this snippet got me on the right track..


Here's what I ended up using.


while read atdout; do

while read accessgrp; do
at -c $atdout | grep -wq...
1,376
Posted By woodson2
Thank you. I will give this a try.
Thank you. I will give this a try.
1,376
Posted By woodson2
Thanks for your reply. I don't think the...
Thanks for your reply.

I don't think the grep -f option will work in this case because I'm grepping on stdout from the at command and not to inside of a file during the loop.

Can you give me an...
1,376
Posted By woodson2
Read loop from two files using descriptors
What I would like to do is read each line in the atdinfile:

A sample atdinfile would look like this:
651
652
653
654
655
656
657
658
659
660
661
664
665
666
667
668
4,680
Posted By woodson2
This seems to work very well. Thank you.
This seems to work very well. Thank you.
4,680
Posted By woodson2
Thanks, Can you show me how this code...
Thanks,


Can you show me how this code fits into what I have already?
4,680
Posted By woodson2
Piping the "script" command through the logger command.
I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good.

Now I'd like to pipe the same output from script through the logger command so...
8,996
Posted By woodson2
Using grep with hyphens
This is on a RHEL 6 box with bash 4.1.2

I'm trying to to use grep to only find those lines containing matches that form whole words.

The -w option works fantastic unless of course that word has...
4,773
Posted By woodson2
Thanks for this code. Although it's not...
Thanks for this code.

Although it's not quite what I'm looking for it's definitely a more portable way of doing things.

The code you proposed results in the following output:

Please enter...
4,773
Posted By woodson2
Using read to prompt for editable user input in Bash 3
Below is a simple script to prompt for user input while suggesting an editable default value at the prompt:


shortname=user1

read -e -i $shortname -p "Please enter the username you would like...
2,912
Posted By woodson2
This is perfect. It actually works better that it...
This is perfect. It actually works better that it did before because now a hyphenated last name is now valid as well.

Thank you.

I guess I'm going to have to do some more reading on regular...
2,912
Posted By woodson2
If I use the code below without the double and...
If I use the code below without the double and single quotes Test Name is invalid.


if [[ "$givenName" =~ ^[A-Z]([a-z]|[A-Za-z])+\s+[A-Z]([a-z]|[A-Za-z])+(-[A-Z]([a-z]|[A-Za-z])+)*$ ]]
then
...
2,912
Posted By woodson2
I'm having the same issue in this regex. if I...
I'm having the same issue in this regex. if I remove the quotes in this one then
something like Test Name comes back as invalid whereas in bash 3.2 Test Name would be valid but test name would be...
2,912
Posted By woodson2
Thanks, however I wasn't relying on the exit...
Thanks, however I wasn't relying on the exit status, I just put that in the script temporarily while trying to test.
2,912
Posted By woodson2
So simple..Thanks
So simple..Thanks
2,912
Posted By woodson2
Bash regex help
I've been using the following regex below in a bash script on RHEL 5.5 using version
GNU bash, version 3.2.25(1)-release

I've tried using the script on RHEL 6.3 which uses GNU bash, version...
3,420
Posted By woodson2
Works perfectly. Thank you for the timely...
Works perfectly. Thank you for the timely response.
3,420
Posted By woodson2
Variables in heredoc
I currently use this message to send e-mails in a script but I would also like to save the output of this code to a file as well while preserving the variables. What's the easiest way to accomplish...
1,153
Posted By woodson2
I agree with all your points so are you saying...
I agree with all your points so are you saying this is beyond the scope of HERE documents?..Do you have another suggestion besides SED?
Showing results 1 to 25 of 51

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