77,856 reputation
1082185
bio website
location European Union
age
visits member for 1 year, 11 months
seen 22 mins ago

Jun
18
revised Variable scope in while-read-loop on Solaris
I don't want people to beleive sh is the Bourne shell
Jun
17
awarded  Good Answer
Jun
17
comment grep change of line followed by a variable
By modifying your question like that 3 months later, you're invalidating all the answers you've received. It's also unlikely that people will notice that you've changed the requirements. It would be better to ask a separate question.
Jun
17
comment Mount a seriously damaged NTFS partition on an HDD with a lot of bad sectors?
Use ddrescue, that's what it's for, to dump the content into an image (with -S for sparse file). ntfsclone --rescue could be another option, but I would feel a lot better when all the sectors that could be salvaged from that drive have been copied somewhere else rather than finding the best solution to save space.
Jun
17
revised Variable scope in while-read-loop on Solaris
deleted 2 characters in body; edited tags
Jun
17
answered Variable scope in while-read-loop on Solaris
Jun
17
awarded  Good Answer
Jun
17
awarded  Enlightened
Jun
17
awarded  Nice Answer
Jun
17
comment File ID that doesn't change upon rename
the combination of st_dev + st_ino + st_birthtim (on systems that have it) should make it reliable. Otherwise, you could have issues if inode numbers are reused.
Jun
17
revised “including” files in fstab
added 4 characters in body
Jun
17
comment Array in unix Bourne Shell
Yes in POSIX shells, you should prefer $(...) over `, but the OP's /bin/sh is probably a Bourne shell, not a POSIX shell. Beside seq not being a standard command, doing $(seq 100) means storing the whole output in memory, and that means it depends on the current value of $IFS containing newline and not containing digits. Best to use i=1; while [ "$i" -le 100 ]; ...; i=$(($i + 1)); done (though that wouldn't work in the Bourne shell either).
Jun
17
revised Array in unix Bourne Shell
added 129 characters in body
Jun
17
comment Array in unix Bourne Shell
@NoobGeek, the Bourne shell doesn't have the $(...) syntax. So you must indeed have the Bourne shell. Are you on Solaris 10 or before? Chances are you won't have a seq either. On Solaris 10 and earlier, you want /usr/xpg4/bin/sh to have a standard sh instead of a Bourne shell. Using seq that way is not very good either.
Jun
17
comment Rename files with spaces in a BusyBox shell
Since the touch command works, it looks more like it's a problem with mv than with the shell. I suspect that mv is a (poorly written) shell script. What does type mv tell you. What about file /path/to/mv assuming file is available?
Jun
17
comment bash script [ x$1 = x ]
@glennjackman, that last sentence is incorrect. Solaris 10 still is the most widely deployed version of Solaris and [ "$1" = "" ] still doesn't work with its /bin/sh (though you'd want to use /usr/xpg4/bin/sh there, not /bin/sh). dash was fixed in that regard in January 2009.
Jun
17
comment bash script [ x$1 = x ]
@MacLemon, the OP also has #!/bin/sh in his script so he's obviously confused as to what bash or sh are or are meant to be.
Jun
17
revised Array in unix Bourne Shell
added 184 characters in body
Jun
17
answered Array in unix Bourne Shell
Jun
17
comment how to set and use multiple parameters in single environmental variable in fish shell
Though it sounds like it's what the OP is asking, I don't think it is what he wants.