Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: mrtiller
2,011
Posted By mrtiller
use expr to add 512 and again to divide by 1024 ...
use expr to add 512 and again to divide by 1024

X=`expr val_in_kilobytes + 512`
MB=`expr $X / 1024`
3,683
Posted By mrtiller
If you have your heart set on doing it in sed: ...
If you have your heart set on doing it in sed:

sed '
/(NP/ {
:loop
N
s/\n/ /
/)$/ !b loop
}
' file

I've always had problems using "\n" on the left side of "s" commands, but if it's...
89,908
Posted By mrtiller
make sure rm is not aliased to something like "rm...
make sure rm is not aliased to something like "rm -i" by doing

type rm

If it is, you can bypass the alias by doing

/bin/rm file
1,475
Posted By mrtiller
awk '{if($1 ~ "^[1-9]".*)printf("%d ",$1); if($NF...
awk '{if($1 ~ "^[1-9]".*)printf("%d ",$1); if($NF ~ "\\([A-D]\\)") printf("%s",$NF"\n")}' abc.txt

Put the entire regular expression within the quotes:

if($1 ~ "^[1-9].*".*)

Also, it would...
21,525
Posted By mrtiller
At the beginning of the backup process, use the...
At the beginning of the backup process, use the "touch" command to create a file called, say, "timestamp." This file will have a modification time corresponding to when the "touch" command was...
2,713
Posted By mrtiller
use cpio or tar
use cpio or tar
4,566
Posted By mrtiller
Several things you might want to check: 1....
Several things you might want to check:

1. make sure VIMINIT is not set if you intend to use EXINIT.
VIMINIT takes precedence over EXINIT.

2. After you invoke vi, try the following ex command...
5,122
Posted By mrtiller
The following will process the back arrow keys by...
The following will process the back arrow keys by removing the codes for these keys plus removing the previous character (since the codes are indicating this character should be deleted):
...
5,122
Posted By mrtiller
Try using backspace instead of the left cursor...
Try using backspace instead of the left cursor key.

When I run it on Cygwin, it does not crash. However, it does not process correctly due to the codes generated by the left cursor key and I get...
2,774
Posted By mrtiller
Try declaring the variables used by the function...
Try declaring the variables used by the function to be local
5,210
Posted By mrtiller
1. What do you mean by "word"? If you mean...
1. What do you mean by "word"? If you mean strictly alphabetic characters then the first line has the first word as "root" and the second word as "pts", but the second line has the first word as...
Forum: Programming 08-03-2009
7,803
Posted By mrtiller
The result of this operation is undefined. ...
The result of this operation is undefined.
g++-4.2 gives the following error message:
warning: operation on 'i' may be undefined
The reason for this is explained at
Sequence point - Wikipedia,...
6,442
Posted By mrtiller
Use the "pr" and "expand" commands to expand tabs...
Use the "pr" and "expand" commands to expand tabs to spaces and to specify a tab width value.
22,516
Posted By mrtiller
Are you sure you are using version 3 or newer of...
Are you sure you are using version 3 or newer of bash?
To see which version you are using, do the following:

echo $BASH_VERSINFOThere is some example code at
Bash Regular Expressions | Linux...
3,617
Posted By mrtiller
#!/bin/sh while read LINE do ...
#!/bin/sh

while read LINE
do
case "$LINE" in
[A-Za-z]) echo "alpha";;
*) echo "not alpha";;
esac
done
Forum: Programming 07-26-2009
7,803
Posted By mrtiller
please see Sequence point - Wikipedia, the free...
please see Sequence point - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Sequence_point)
1,251
Posted By mrtiller
The following seems to work: sed...
The following seems to work:

sed 's/<xsl:include href="\([A-Za-z]*\)/<xsl:include href="\1_tmp/' fileOne.xlsThe expression "[A-Za-z]" assumes filenames (excluding the ".xls" part) have only...
Showing results 1 to 17 of 17

 

Featured Tech Videos

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