Search Results

Search: Posts Made By: hbar
36,503
Posted By hbar
The colon and comma sit just after column 2 and...
The colon and comma sit just after column 2 and column 1. Can I place them in the middle of the spaces?

For example, if I have 4 spaces, a comma will sit on the 3rd space and there will be a gap...
36,503
Posted By hbar
I think I can create my own spaces and insert...
I think I can create my own spaces and insert comma, colon etc between them. But it may be difficult to exploit the spacing that I already have between columns.
1,829
Posted By hbar
Rounding off to the nearest floating number
I have a number, which I want to convert into the nearest floating number upto two places after the decimal point.

E.g.

1.2346 will become 1.23

but

1.2356 will become 1.24 .

Similarly...
36,503
Posted By hbar
But it then removes the spaces that I already...
But it then removes the spaces that I already have, e.g.

awk -v OFS=' ' '{$1=$1};1' f1 | awk '{ print $1","$2":"$3 }'

removes the space I created before the pipeline !

I do not want to...
36,503
Posted By hbar
What about my original second question: comma...
What about my original second question:
comma between 1st and 2nd column, and colon between 2nd and 3rd column ?
36,503
Posted By hbar
I get only change in space between 1st and 2nd...
I get only change in space between 1st and 2nd column. Could you explain what is happening?

I also believe that there must be a smart 'awk'-way to do these.
36,503
Posted By hbar
Insert space or pattern between columns in a data file
I have a data file where three data sets are written in three columns. Can I increase the space between the columns without reading them?


Also can I insert particular patterns, say comma between...
1,270
Posted By hbar
balajesuri and Jtone's suggestion work fine....
balajesuri and Jtone's suggestion work fine. Thanks.
1,270
Posted By hbar
Insert text before first 'n' lines
I want to put a particular text, say, the hash '#' before each of the first n lines of a file.

How can I do that?
Forum: Programming 01-05-2013
11,817
Posted By hbar
Thanks. But what will be compilation command? Is...
Thanks. But what will be compilation command? Is it something like:

ifort --extend-source 132 <filname>.f ?
Forum: Programming 01-05-2013
11,817
Posted By hbar
getconf LINE_MAX gives 2048 Right now I...
getconf LINE_MAX gives
2048

Right now I am using Intel fortran compiler (ifort).
Forum: Programming 01-05-2013
11,817
Posted By hbar
Maximum length of a line
How can I change the maximum length of a programming line in fortran and C (specifically in fortran 77)?


Seems the default maximum length is 72 in fortran 77.

Thanks.
5,234
Posted By hbar
Extension to the previous problem
What if I want to print x keeping 0 before the decimal point irrespective of the case x having the 0 already or not?

For example,

if x=0.0090, I should print 0.009

and also

if x=.0090,...
8,216
Posted By hbar
cat /tmp/alarm.loggives /bin/sh: 1:...
cat /tmp/alarm.loggives
/bin/sh: 1: alarm.bash: not foundBut I don't see anything to happen from the command line.

Let me state once again what I have done.

I have created a bash file called...
18,304
Posted By hbar
You're right. But that perhaps doesn't answer my...
You're right. But that perhaps doesn't answer my question. Is there a way to break the command line for crontab?
8,216
Posted By hbar
Sorry. It's not working. I have made a file, say...
Sorry. It's not working. I have made a file, say "cronfile",
which contains the above line.

Then if I execute

crontab cronfile

I don't get any result !
8,216
Posted By hbar
Are you meaning to execute from /etc/crontab?...
Are you meaning to execute from /etc/crontab? Can't I do it by

crontab <filename>.bash

?
8,216
Posted By hbar
@agama. Putting a baclslash makes it work....
@agama.

Putting a baclslash makes it work. Thanks. However, voume does not keep on increasing!

@Corona688

I'm using gnome desktop in ubuntu 12.04. I copied the structure from the internet ...
8,216
Posted By hbar
crontab+mplayer alarm clock
I'm trying to run a alarm.sh using crontab, which play a song as
an alarm at 6.15 am. I'm using amixer so that volume increases by 10% in every loop.

My script is the following. ...
18,304
Posted By hbar
Thanks a lot. Actually I had been using crontab....
Thanks a lot. Actually I had been using crontab. There the escape was not working!
5,234
Posted By hbar
Yes, it works now. Thanks. :)
Yes, it works now. Thanks. :)
18,304
Posted By hbar
I'm using Red Hat (Scientific Linux). ...
I'm using Red Hat (Scientific Linux).

getconf ARG_MAX

gives

131072

What about breaking command line?
5,234
Posted By hbar
This works fine. But when I use x=`echo "$x" |...
This works fine. But when I use
x=`echo "$x" | awk '{sub("0*$","",$0);sub("\\.$",".0",$0)}1'`

I get the following error message.

awk: warning: escape sequence `\.' treated as plain `.'

and...
18,304
Posted By hbar
Is there a maximum length for a shell script command?
Is there a maximum length for a shell script command? How can I detect that in my OS?

For example, if I have something like:

command A | command B | command C | awk '{print $1 $2 $3 $4 $5}' ...
5,234
Posted By hbar
Thanks burtas11. That serves the purpose.
Thanks burtas11. That serves the purpose.
Showing results 1 to 25 of 46

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