General :: Awk Does Not Print The Value Of The Variable As Expected
Apr 4, 2011
I have this simple awk program but it not prints var_cab whe^E or ^S or ^M after he finds the second ^C
/^C/ { var_cab = substr($0,1,28); ent = 0 ; print "estoy en cabecera" var_cab;}
/^E/ { if ( ent ==0 ) var_fech = substr($0,4,8) ; ent ++;
print var_cab var_fech $0; }
/^S/ { print var_cab var_fech $0; }
/^M/ { print var_cab var_fech $0; }
END { print var_cab,ent}
the input file is many lines like this, every new block stats with ^CAB
CABES3000088888880000007EAMB
ENT20090706D060709-888 0028560000000012VALLE CA'ZULIA5501, 5502, 5498 y 5535
SAL201008250000134900000321V1202935-MU
[code]....
View 4 Replies
ADVERTISEMENT
May 16, 2011
problem statement:
pattern_search="Exam Name"
sed -n "/$pattern_search/,/hello/"p tmp5 | awk '{if ( $4 != 0 && $4 ~ /[0-9]+.*[0-9]*/ ) print "$pattern_search" " " $0 }'
"tmp5" is a file. this is printing output as
$pattern_search value1
i.e value of $pattern_search is not getting substituted. i am expecting output as
Exam Name value1
View 3 Replies
View Related
Feb 17, 2011
how to assign a local variable value to a global variable....
View 2 Replies
View Related
Apr 16, 2011
I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)
View 3 Replies
View Related
Oct 23, 2010
I would like to access/print a C Variable of any type "as it is stored in the memory". I would expect the output to be an array of bits. Whats the simplest/shortest way to do that?
View 14 Replies
View Related
Mar 23, 2010
How can I combine multiple single page prints into a single print job? For example, using Firefox on Linux one can print a web page such that each sheet of paper has four pages printed upon it. I would like to combine several separate web pages so that for example, web-page-a, web-page-b and web-page-c (each less than one print page long) are printed on a single sheet of paper.
I would like to do this without having to use some form of image editor to combine and manage manually created temporary files.
View 1 Replies
View Related
Jul 25, 2010
can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example
objectnames1=`ls -a`
objectnames2=`ls -a`
etc.
i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.
if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...
View 6 Replies
View Related
Dec 27, 2010
I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?
#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)
[code]...
View 6 Replies
View Related
May 13, 2011
On Slackware64 13.1 the as-installed en_GB locale gave Sunday as the first day of the week. This was not an issue until Xfce's Orage calendar was used when its display of Sunday as the first day of the week was offputting for someone used to Monday. A minor inconvenience but expected to be easy to fix.
At the command line:
Code:
c@CW8:~$ export LANG=en_GB <== same for en_GB.utf8
[code]....
View 2 Replies
View Related
Oct 14, 2010
$dec93 = 93;
$ser = SERVO;
$lbit = uc(sprintf("%02x
", $dec93));
if($lbit == 5D){
print DATA "Byte11: $fbits11=$bstr11 Bits:[95-88] $ser
";
}else{
sleep(1);
}
Why do I get this error? Bareword found where operator expected at C:Perl ScriptsLbits.pl line 64, near "5D" (Missing operator before D?)
View 2 Replies
View Related
Feb 18, 2010
I am trying to use the Linux Ramdisk y machine and followed the instructions oninux/Ramdisk/ramdisk.html to create a 4GB ramdisk (total memory is 8GB, linux 2.6.9)The issue is that it is taking me almost exactly the same time to read a 1GB file from ramdisk as it is from disk. I was expecting it to be atleast twice as fast.Has anyone encountered this before?
View 1 Replies
View Related
Jun 25, 2011
Y want to rename a bunch of files and directories to remove the space on the names, easy enough right?
Code:
for source in $(find ./); do target=$(echo "$source"|sed -e 's/ /_/g'); mv -f "$source" $target; done
Well, I thought that should have work but the problem is that $source comes up broken, when I run it with echo instead of mv I get the echo with broken names.
Code:
In this case "$source"="This is the file I want to rename"
$ echo "$source"
[Code]....
View 3 Replies
View Related
Feb 2, 2010
I worte some code, but I got error for complier.
Code is :
#include <stdio.h>
#include <stdlib.h>
[code]...
View 4 Replies
View Related
Dec 10, 2010
I am trying to install NS-2.1b9a in Fedora 8.0. I have already installed gcc-3.3 and made new link to the newly installed gcc. I used patch made for NS-2.1b9a (found in [URL]...-8-ubuntu.html) to install in Fedora 8.0. Now, when I run ./install I get follwoing error.
[Code]..
View 2 Replies
View Related
Feb 27, 2010
I have an Acer Aspire 6930g with an nVidia GeForce 9300m GS which has a broken screen. I have been using an external monitor for some time using Linux Mint, without issue.
I initially set this up with great difficulty using the small parts of the screen that would still display an image at the time. Now, however the screen is totally dead, I have since disconnected the laptop monitor in order to not cause issues.
The issue I am currently having is trying to use live distros.
I'll give you example: I boot ubuntu 9.10 32bit and it gets to the initial boot menu. I choose "Try Ubuntu..." It shows the loading screen. Screen goes blank when going to desktop
I tried Ctrl+Alt+F1 to get to a terminal, but the screen stays blank. The same thing happens with both Knoppix and Backtrack 4 as well. The display goes blank upon switching to the desktop.
View 2 Replies
View Related
Aug 21, 2009
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
View 6 Replies
View Related
Apr 7, 2010
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
View 4 Replies
View Related
Jun 10, 2009
I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?
View 2 Replies
View Related
Apr 25, 2011
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
View 5 Replies
View Related
Dec 8, 2009
On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.
View 5 Replies
View Related
Apr 28, 2010
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies
View Related
Feb 21, 2011
I have a program that takes a relative path as input appends it to a some path string to get the actual path.
Now all I can input is the relative path. So if I want to go one level above my input will be ../mypath.
If I know the depth of the path used internally, I can use .. as many times to go to the root directory and then give the absolute path. But suppose I do not know the depth of the directory, can I construct a relative path string such that it considers it as a relative path. One way could be to have enough .. in the path string so that I can force an absolute path for some maximum depth of path.
Is there some path string syntax that I am not aware of but can achieve this?
View 2 Replies
View Related
Apr 23, 2010
I am using Scientific Linux version 2.6.9-67.EL.cernsmp (root@lxcert-i386) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 SMP Wed Nov 21 16:22:33 CET 2007. Now I want to install rediff bol in it. so i downloaded rediff bol from the site
Code:
http://linux.softpedia.com/progDownload/rediffbol-prpl-Download-34762.html
after that i have downloaded libpurple and libpurple developement from
[code]....
View 2 Replies
View Related
Nov 8, 2010
if [ $games -gt 0 ] ; then
echo ""
echo "*** New Game! ***"
[code]....
View 6 Replies
View Related
Dec 6, 2008
I initially had a problem accessing the CUPS interface (see my other post) and got that resolved by adding the user "cupsys". Now, everything "looks" ok, and when I print a test page, it shows it as completed (in CUPS). However, the page never prints.
The printer is a Canon MP600 (using the canonmp600en.ppd file to configure it). Here's the output of my conf file.
Code:
# Show troubleshooting information in error_log.
LogLevel debug
[code]...
View 8 Replies
View Related
Mar 23, 2011
Interesting problem: For the first time with Xubuntu 10.10 64bit, I am finding certain applications print corrupt. A varying amount of letters / numbers either get substituted/print a blank space/ print a box etc etc. This corruption seems to happen from a Pdf ( evince ) or Spreadheet ( Gnumeric ) Opening the same Pdf on another machine (ubuntu 10.10 32bit) prints perfectly. Opening the same .xls file on the original computer but using OOo Calc prints perfectly.
I guess I have ruled out any problems with the printer itself or the network JetDirect box. I have re-installed CUPS and evince and upgraded to the latest version of HPLIP but the problem appears unchanged.
View 2 Replies
View Related
Jun 5, 2011
I cannot print pdf files. I have tried using okular and xpdf. The documents display in the program, but print preview shows a blank page. The printer then sends out blank pages. I have tried printing on 2 different printers using usb cables. Using terminal to process the commands shows error:
Quote:
xxx@xxx:~$ xpdf
***** MediaBox = ll:0,0 ur:611.976,791.968
***** CropBox = ll:0,0 ur:611.976,791.968
***** Rotate = 0
Segmentation fault
Converting to .ps also is blank.
View 6 Replies
View Related
Dec 26, 2010
My wife has a canon MP470 printer and running ubuntu 10.10. I am able to print black and white, but unable to print photos. I got it to work using another driver, but not the 'correct' one for this printer. I have searched a bit and don't see anything about ubuntu 10.10, just older versions. Or should I just network her to my printer....?
View 5 Replies
View Related
Feb 16, 2011
I'm running Kubuntu 10.10 with a Laserjet 5M printer. When I attempt to print a job from Firefox or from Okular, the job never gets onto the print queue. However, I can print test pages on the printer and also print from OpenOffice, so this seems to be app-dependent. I know the jobs aren't being queued because the job number doesn't increase (as shown by the jobs for the test pages). Both Firefox and Ocular give every indication that the print job has been processed correctly.
View 1 Replies
View Related
Feb 26, 2011
Not sure when CUPS started acting up. I have the latest 13.1 current software installed.The first page to print is always OK, but all succeeding pages are overwritten. The second page shows the first page on top of it, and the third shows the preceding pages on top of it - and so on. Has anyone else seen this problem?I guess the printer buffer is not getting flushed correctly. If my configurations were trashed in some way, I don't know where to look for a fix.
View 14 Replies
View Related