Search Results

Search: Posts Made By: aav1307
1,500
Posted By RudiC
Please use code tags as required by forum rules! ...
Please use code tags as required by forum rules!

That depends on VAR1's contents. If created with "\n" separators, use double quotes when using (echoing) the variable.
If it just contains spaces,...
Forum: HP-UX 09-09-2015
5,413
Posted By Peasant
No need to delete the data. If you are not...
No need to delete the data.

If you are not using LVM, a simple newfs command will create filesystem, then you mount it and use it as you see fit.

If you are using LVM, simple do a pvcreate on...
2,312
Posted By MadeInGermany
sed 's#/.*##' file1 Skip lines without a /: ...
sed 's#/.*##' file1
Skip lines without a /:
sed -n 's#/.*##p' file1
36,054
Posted By sea
$(hostname) (which is the same as `hostname`) or...
$(hostname) (which is the same as `hostname`) or $HOSTNAME could by tried as well.

hth
36,054
Posted By RavinderSingh13
Hello aav1307, Could you please try...
Hello aav1307,

Could you please try following and let me know if this helps.

touch file1-$(date +%Y-%m-%d_%H:%M:%S)_`hostname`


Thanks,
R. Singh
1,284
Posted By RudiC
Did you consider searching these fora, or even...
Did you consider searching these fora, or even look at the link at the bottom of this page?
2,036
Posted By RavinderSingh13
Hello aav1307, Following may help you in...
Hello aav1307,

Following may help you in same.(Not tested though)
Code 1: Following one will check if number of fields are one or line is empty it will not print those lines.

awk '{if(NF==1 ||...
2,036
Posted By senhia83
your request is not clear if you want to...
your request is not clear

if you want to delete completely empty lines, try sed
sed '/^\s*$/d' file


your example will work with

awk 'NF!=1' file
7,555
Posted By RavinderSingh13
Hello aav1307, Following may also help you...
Hello aav1307,

Following may also help you in same.

cat file{1,2} > OUTPUT_file ##In Bash, ksh, zsh

OR

awk '1' file1 file2 > OUTPUT_file
OR
awk '1' file{1,2} > OUTPUT_file ##In...
3,503
Posted By RudiC
appreciate the repeat - until!
appreciate the repeat - until!
3,503
Posted By MadeInGermany
Indeed the output was not exact, and one line was...
Indeed the output was not exact, and one line was even left out.
Here is another fix:
while
read line2 <&4
e2=$?
read line1 <&3 || [ $e2 -eq 0 ]
do
if [ -z "$line1" ] && [ -n "$line2"...
3,503
Posted By RudiC
Nice! But - two lines are missing, the ones...
Nice!

But - two lines are missing, the ones that would be first to be printed alone.

And, if you reverse the order of the files, you get 111 aaa
222 bbb
ddd
eee
fff

333 ggg
444 hhh...
3,503
Posted By MadeInGermany
Here is a general merge #!/bin/sh while ...
Here is a general merge
#!/bin/sh
while
read line2 <&4
e2=$?
read line1 <&3 || [ $e2 -eq 0 ]
do
if [ -z "$line1" ]
then
while read line2 <&4 && [ -n "$line2" ]
do
printf...
1,229
Posted By jim mcnamara
What is ' file find pattern'? 1. a pattern in...
What is ' file find pattern'?
1. a pattern in the file name
2. a pattern in the file's data

What is 'new file output'?
1. write to a new file
2. copy the file to a new location

Please give...
3,503
Posted By Don Cragun
For something that can take any number of groups...
For something that can take any number of groups separated by blank lines in both files, your could try:
awk '
function print_rest() {
while(c1[g2] > c2)
printf("%s\t\n", d[g2, ++c2])...
3,503
Posted By rdrtx1
try also: awk ' FNR==1 {l=0} ! /./ {l=1;...
try also:
awk '
FNR==1 {l=0}
! /./ {l=1; if (FNR!=NR) print; next}
FNR==NR { if (! l) { a[a1++]=$0; } else { b[b1++]=$0; } ; next }
{if (! l) {c=a[a2++]} else {c=b[b2++]}; print $0, c}
'...
3,503
Posted By RudiC
Try this (an ad hoc quick and dirty solution for...
Try this (an ad hoc quick and dirty solution for exactly your samples, no error checking etc.):awk '/^$/ {do {ST=getline S0 < F1; print S0} while ((ST==1) && S0!=""); next}
...
3,503
Posted By blackrageous
Confused. What exactly are you asking? It looks...
Confused. What exactly are you asking? It looks like you have resolved your own issue.
973
Posted By blackrageous
This is confusing. You're using both back ticks...
This is confusing. You're using both back ticks ` and $(). It's not a problem; however, given some syntax issues with your example, it's not clear. For example, what exactly is command1
...
1,150
Posted By rdrtx1
try also: awk 'NR>1' infile
try also:
awk 'NR>1' infile
1,150
Posted By MadeInGermany
sed 1d filex
sed 1d filex
1,150
Posted By vgersh99
obe way: sed -n '2,$p' myFile
obe way:

sed -n '2,$p' myFile
1,193
Posted By RudiC
How about column -t file data description ...
How about column -t file
data description importantainfo
121 desp1 info1
122 desp2 info21
2342 desp3 info32
5345 desp4 info43
1,193
Posted By vgersh99
you can play with the 'fmt' value to get where...
you can play with the 'fmt' value to get where you want to be:

awk -v fmt='%-10s%-15s%-15s\n' '{printf fmt,$1,$2,$3}' myFile
---------- Post updated at 11:45 AM ---------- Previous update was...
1,280
Posted By Akshay Hegde
akshay@Aix:/tmp$ pr -m -t -s' ' file1 file2 1...
akshay@Aix:/tmp$ pr -m -t -s' ' file1 file2
1 aaa bbb ccc
2 ddd eee fff
3 ggg hhh iii
Showing results 1 to 25 of 28

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