Search Results

Search: Posts Made By: user052009
8,933
Posted By user052009
Gave a thumbs up as well. Definitely appreciate...
Gave a thumbs up as well. Definitely appreciate the feedback and excellent discussion.
8,933
Posted By user052009
Thanks for the reply. Appreciate it.
Thanks for the reply. Appreciate it.
8,933
Posted By user052009
ksh String Manipulation - removing variables from within a variable
Hi. I'd like to remove all values in a string variable that also exist in a second variable. What is the appropriate approach to take here? I can use a 'For' loop and check each element and then...
3,765
Posted By user052009
I can only imagine I somehow pressed shift alt...
I can only imagine I somehow pressed shift alt (on a mac) along with - when typing that in. It was the only place it occurred. It's great to now have an approach for working this out. Thanks guys.
3,765
Posted By user052009
That's brilliant. I hadn't seen the en-dash but...
That's brilliant. I hadn't seen the en-dash but it explains everything perfectly. Thank you so much for clearing this up.
3,765
Posted By user052009
It's caused when the first character in the...
It's caused when the first character in the options field is a dash. I'm calling the script from the command line. The script was edited using vi. Here's the full output with debug when I use...
3,765
Posted By user052009
Yes indeed there is some old code preceding this...
Yes indeed there is some old code preceding this that reads in the params from the command line:


while [ -n "$1" ]; do
case $1 in
-username) if [ "`echo $2 | grep...
3,015
Posted By user052009
Using getopts
Hi. Can somebody please show me an example of how to use getopts to assign a variable if it's been passed into the script but to set a default if no value has been passed in? And also how to handle a...
3,765
Posted By user052009
Looks like it's UTF-8. Any idea how can I get rid...
Looks like it's UTF-8. Any idea how can I get rid of this hidden character?


+ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"...
3,765
Posted By user052009
ksh hidden characters in variables
Hi. I'm getting the following hidden characters \u[2013]at the start of a string after I pass in variables from the command line. I only noticed this when I set -x in my KSH script. Can anybody tell...
5,316
Posted By user052009
yep ... that does the job. Many thanks.
yep ... that does the job. Many thanks.
5,316
Posted By user052009
Thanks Don. But how do I read the parameters into...
Thanks Don. But how do I read the parameters into that case statement from a variable set within the script rather than the command line?
5,316
Posted By user052009
ksh parsing arguments in a string rather than from the cmdln
Hi. I have a piece of code that reads and parses command line options. I'd like to alter it slightly to read from a string (that's set elsewhere in the script) rather than directly from the command...
2,140
Posted By user052009
Hi Jim. Actually I originally only wanted to...
Hi Jim. Actually I originally only wanted to check that the dir existed but then had to change it to handle the possibility of multiple dirs with the same name in different directory trees. I don't...
2,140
Posted By user052009
ksh - Checking directory trees containing wild cards
Hi

Can somebody please show me how to check from within a KSH script if a directory exists on that same host when parts of the directory tree are unknown?

If these wildcard dirs were the only...
2,159
Posted By user052009
Works perfectly. Thank you very much.
Works perfectly. Thank you very much.
2,159
Posted By user052009
Thanks Rudi. Getting the following when I run it...
Thanks Rudi. Getting the following when I run it from within a script (although it works on the cmdln):
./p.ksh: line 4: syntax error at line 5: `^' unexpected
1,525
Posted By user052009
yes, that works! :) Thanks
yes, that works! :)
Thanks
1,525
Posted By user052009
Will the command set -- $OPTPARMS not push the...
Will the command set -- $OPTPARMS not push the values in $OPTPARMS back onto the input stack?

So the code in the first post will stay the same if I use this cmd before it?
1,525
Posted By user052009
Thanks Santiago. I need to pass in a variable...
Thanks Santiago. I need to pass in a variable into the while loop. The values in $OPTPARMS will change every run.
So set -- $OPTPARMS before the while loop should work, right?
2,159
Posted By user052009
Parameter parsing
Hi. I need to parse a string with several optional parameters such as the following:
PARAMS="-server testserver -type standby -host testhost1"

How can I parse this to place any values after...
1,525
Posted By user052009
Processing arguments in a string
Hi

The following code works when reading the arguments from the command line but fails when I try to read from a string. So this works


while [ -n "$1" ]; do
case $1 in
-dbversion)...
1,982
Posted By user052009
Thanks Jim. Unfortunately I get the following...
Thanks Jim. Unfortunately I get the following error when trying to create a hard link:
Invalid cross-device link

---------- Post updated at 02:26 AM ---------- Previous update was at 02:24 AM...
1,982
Posted By user052009
Find cmd and sym links
Hi. Can somebody tell me if there's a way of creating a symbolic link from a directory on one filesystem to that on another that will allow a find command that doesn't use the -L param to locate a...
4,478
Posted By user052009
Cmd 'cat /dev/urandom' not closing cleanly
Hi

I'm running the following command to generate a random password in a KSH script on a RHEL Linux VM but for some reason the cmd is not being closed and it's causing problems on the host.
...
Showing results 1 to 25 of 58

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