Search Results

Search: Posts Made By: Matt Miller
2,276
Posted By Matt Miller
That is not true. If getopts is configured to...
That is not true. If getopts is configured to allow "+" to precede option letters, then the opt parameter that comes back during the processing loop has a "+" sign in front of it. So, I just hadn't...
2,276
Posted By Matt Miller
I think I did supply most of the info you...
I think I did supply most of the info you mention. I posted script snippets and explanations of how the scripts are used. There are no error messages, and OS and version are, I think, irrelevant,...
2,276
Posted By Matt Miller
ksh "getopts" -- Unsetting an Option
I use the "getopts" ksh built-in to handle command-line options, and I'm looking for a clean/standard way to "unset" an option on the command line. I don't know if this is a technical question about...
7,375
Posted By Matt Miller
Right, and variables explicitly declared with...
Right, and variables explicitly declared with "typeset" can't escape their function. For example:

x="outside f"
function f
{
typeset x="inside f"
}
f
print $x
outside f

----------...
7,375
Posted By Matt Miller
Well, I'm in a function here, and I don't want to...
Well, I'm in a function here, and I don't want to name clash, so I use typeset. The function is a widely-used utility function. I suppose I could follow some naming convention to help prevent...
7,375
Posted By Matt Miller
Even if I unset the parameter the "Version M 93t+...
Even if I unset the parameter the "Version M 93t+ 2009-05-01" ksh insists on telling me the value is 0:

$ typeset -i x
$ print $x
0
$ unset x
$ print $x
0
$ set |grep x=
x=0
7,375
Posted By Matt Miller
Yeah, but I'm looking to portably implement the...
Yeah, but I'm looking to portably implement the other behavior, where an unset parameter is empty.
7,375
Posted By Matt Miller
That was my intention in this case. I wasn't...
That was my intention in this case. I wasn't actually looking to format the variable. I'm just using it as a binary flag. If the flag is not empty then my code was assuming that it had been...
7,375
Posted By Matt Miller
ksh "typeset -i" and Empty Parameters
I'm getting different behaviors for "typeset -i" on different systems. In one case unset parameters are 0, and in another case they're empty. Is one of these behaviors correct, or is the behavior...
5,527
Posted By Matt Miller
That sounds promising. So: # losetup...
That sounds promising. So:

# losetup /dev/loop0 /path/to/dev_sda.17-Mar-2012
# parted /dev/loop0
...
(parted) p
Model: ...
5,527
Posted By Matt Miller
Linux. mount -t ext3 -o loop...
Linux.

mount -t ext3 -o loop /path/to/dev_sda.17-Mar-2012 /mntI've tried that (actually, -t ext4), but:

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage...
5,527
Posted By Matt Miller
Access a File as a Device?
I backed up my 320GB hard drive to a file with dd:

dd if=/dev/sda of=dev_sda.17-Mar-2012 bs=1048576The main idea was to be able to be able to completely replace my hard drive from this backup if...
Showing results 1 to 12 of 12

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