Search Results

Search: Posts Made By: agn
1,399
Posted By agn
Try: awk -F',' 'BEGIN { OFS=","; p=0 } $1...
Try:


awk -F',' 'BEGIN { OFS=","; p=0 } $1 != 0 { p = $1 } { $1 = p }1' file
14,269
Posted By agn
Try: for f in *txt.xls; do s=${f#*.};...
Try:


for f in *txt.xls; do s=${f#*.}; p=${f%.$suffix}; echo mv $f ${p}_$(date +%Y%m%d_%H%M%S%N).${s}; done
7,402
Posted By agn
Couple of ways to get the filename. [~]>...
Couple of ways to get the filename.


[~]> awk 'OFS="," { print FILENAME, $0 }' /etc/passwd
/etc/passwd,root:x:0:0:root:/root:/bin/bash
/etc/passwd,bin:x:1:1:bin:/bin:/sbin/nologin...
16,845
Posted By agn
[~]> echo...
[~]> echo "73423555","73423556","73423557","73423558","73423559" | awk 'BEGIN { RS="," }1'
73423555
73423556
73423557
73423558
73423559
2,250
Posted By agn
man last
man last
2,365
Posted By agn
$ cat file1 Tom Dick Harry Charlie ...
$ cat file1
Tom
Dick
Harry
Charlie
$ cat file2
Boston
Newyork
LA
Toledo
$ paste file{1,2} | cat -n
1 Tom Boston
2 Dick Newyork
3 Harry LA
4...
Forum: Programming 11-04-2010
4,461
Posted By agn
Where are you planning to execute it ? Windows or...
Where are you planning to execute it ? Windows or *nix ? a.out is the executable. It is not an object file.
3,217
Posted By agn
You don't need perl for this. You could use a for...
You don't need perl for this. You could use a for loop to go through the files and use stat(1) to get the timestamp.
Forum: Programming 11-04-2010
4,461
Posted By agn
If you have C compiler (cc or gcc) installed, try...
If you have C compiler (cc or gcc) installed, try


$ gcc file.c


This will create the binary, a.out, which you can execute by

$ ./a.out
1,401
Posted By agn
Try using single quote around the element or...
Try using single quote around the element or escape the space.
1,231
Posted By agn
Please paste the relevant code snippet. I'm...
Please paste the relevant code snippet. I'm guessing that you're using localtime. See localtime - perldoc.perl.org (http://perldoc.perl.org/functions/localtime.html) for changing the format.
5,824
Posted By agn
See chown(1)
See chown(1)
Forum: Red Hat 10-26-2010
4,343
Posted By agn
If you properly list the slave as a DNS server...
If you properly list the slave as a DNS server for the zones, I don't see a reason why it shouldn't work.
12,961
Posted By agn
Try, $ find /mount -type d | xargs du |...
Try,


$ find /mount -type d | xargs du | sort -rn
4,864
Posted By agn
malcomex999's solution is better and straight...
malcomex999's solution is better and straight forward.
4,864
Posted By agn
Try this, $ awk '{...
Try this,


$ awk '{ for(i=$NF;(NF-i)<NF;i--) { printf "%s%s",$(NF-i),FS } printf RS }' input_file


I haven't tested all the corner cases.
2,718
Posted By agn
When you execute one.sh, you're executing it in a...
When you execute one.sh, you're executing it in a new shell. If you want to export it in current shell, then use '.' or source.


$ . ./one.sh
1,970
Posted By agn
Instead of using multiple echo's, try using here...
Instead of using multiple echo's, try using here document.


cat > resultofsample.sh <<EOF
#!/bin/bash
# codes
EOF
1,970
Posted By agn
Did you type 'crtl + d' or did you press 'D' key...
Did you type 'crtl + d' or did you press 'D' key while holding down the 'Ctrl' key ? It should be the latter.
1,970
Posted By agn
Type CTRL+D to signal EOF.
Type CTRL+D to signal EOF.
4,434
Posted By agn
$ echo $msg Oct 21 15:00:49...
$ echo $msg
Oct 21 15:00:49 covlsw01.nls.jlrint.com 2010 Oct 21 14:00:49 GMT +00:00 %SECURITY-1-PORTSHUTDOWN:Port 7/28 shutdown due to security violation
$ echo $msg | nawk -F '%' '{ split($1,a,"...
Forum: What is on Your Mind? 10-22-2010
3,100
Posted By agn
I read some really bad review on this one. But,...
I read some really bad review on this one. But, you have to watch Rajini movies with a 'pinch of salt'.
Forum: What is on Your Mind? 10-22-2010
11,636
Posted By agn
Yeah, not many companies in India,...
Yeah, not many companies in India, encourage/allow work-from-home. Even though we get VPN and a laptop, we have to show up in office unless we have a genuine reason (an incident/change that kept you...
2,305
Posted By agn
Use awk. I used nawk because I was on solaris.
Use awk. I used nawk because I was on solaris.
2,305
Posted By agn
$ var='hello' $ nawk -v v=$var 'BEGIN{ print v...
$ var='hello'
$ nawk -v v=$var 'BEGIN{ print v }'
hello
Showing results 1 to 25 of 329

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