Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: agn
710
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
12,937
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
6,501
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...
13,074
Posted By agn
[~]> echo...
[~]> echo "73423555","73423556","73423557","73423558","73423559" | awk 'BEGIN { RS="," }1'
73423555
73423556
73423557
73423558
73423559
1,660
Posted By agn
man last
man last
1,919
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
2,874
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.
2,669
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
2,874
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
980
Posted By agn
Try using single quote around the element or...
Try using single quote around the element or escape the space.
979
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.
4,868
Posted By agn
See chown(1)
See chown(1)
Forum: Red Hat 10-26-2010
3,424
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.
11,121
Posted By agn
Try, $ find /mount -type d | xargs du |...
Try,


$ find /mount -type d | xargs du | sort -rn
2,064
Posted By agn
malcomex999's solution is better and straight...
malcomex999's solution is better and straight forward.
2,064
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,235
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,342
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,342
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,342
Posted By agn
Type CTRL+D to signal EOF.
Type CTRL+D to signal EOF.
3,670
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
2,280
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
9,921
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...
1,751
Posted By agn
Use awk. I used nawk because I was on solaris.
Use awk. I used nawk because I was on solaris.
1,751
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

 

Featured Tech Videos

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