Ubuntu Servers :: Remove The Leading Number And Slash If The Input File Is In The New Format?
Sep 10, 2010
I'm thinking of a few ways to do this I'm curious how many better/equal ways there are to do the same task.in a file with format like: 20 text Gi0/2 some other junk I have it reformatted to look like this before going in a database: 0/2 20 text. But for whatever reason some of the new input text looks like this now: 20 text Gi1/0/2 some other junk
My script makes it look like this: 1/0/2 20 text. I want it to remove the leading number and slash if the input file is in the new format.
View 5 Replies
ADVERTISEMENT
Jun 8, 2010
I ran across this problem when I used checkinstall and then tried to extract the contents of data.tar.gz (which you can find inside any .deb).tar has an option to extract the contents of a file in a given directory.From tar's manpage:
Code:
-C, --directory DIR
change to directory DIR
[code]....
View 2 Replies
View Related
May 6, 2011
I need to have a shell script which does the following,
1. Remove '/' in the file
2. Replace ';' with new line
Input file (sample):
TL/01039;TL/07014;TL/07016;TL/07046;TL/09476;TL/09522
Output file should be:
View 2 Replies
View Related
Mar 28, 2010
I have a script that calls for a file description on a core file. I then pull the name of the process that caused the core file.
unfortunately, the process name is pulled with a leading ' amd a tailing'. I would like to remove the leading char and the last char.
code:
VAR=`file /tmp/core.1432 | awk '{ print $14}'`
echo "Process Name: $VAR"
output:
Process Name: 'ProcessName'
Results I need:
Process Name: ProcessName
I tried sed, but it seems to not like using the special char '.
View 14 Replies
View Related
May 19, 2010
If you create a file on UNIX/linux with special chars, like touch "la*, you can't remove it with rm "la*. You have to use the inode number(you can if you add the before the name, I know, but you'd have to guess as a user that it was used in the file creation).
I checked the manpage for rm, but there's no metion of the inode number. Doing rm inodenumber doesn't work either.
What is the command for this?
View 4 Replies
View Related
Apr 8, 2010
I got a new HDD like a Storage on my Ubuntu ,it is formated as ext3 and i am able to mount it ,but sometimes while downloading from FTP ,when the session broke Ubuntu crates some ./afternature.mp4 Input/output error ,which i can see on "ls -l" ,and that causes great troubles to me ,because i can not copy or write on that disk another file with the same one which is created like this ,these error are gone only if i format the hdd .
My mounting command is "mount /dev/hdb3 /tmp/hd ext3 rw 0 0" So is that possible to remove these error without formatting the disk . PS:I did a lot of search for that error ,on unix forums also here but i didn`t find a concrete answer ,i found a thread which is for that case but removing with inode is impossible because on ls -l i`m not receiving the inode .
View 5 Replies
View Related
May 11, 2011
I followed this tutorial to setup a mail server, followed it to the letter, double/triple/quadruple checked everything for human error, and I can't find anything.[URL].. What's happening is it seems that postfix is adding a trailing slash to usernames when it does the user lookup, so they don't exist and then fail. I've attached the log below.
Code:
May 11 01:06:27 vmail postfix/smtpd[1688]: connect from localhost[127.0.0.1]
May 11 01:06:55 vmail postfix/smtpd[1688]: 3372E982BC: client=localhost[127.0.0.1]
May 11 01:07:18 vmail postfix/cleanup[1691]: 3372E982BC: message-
[Code]...
View 1 Replies
View Related
Jan 21, 2011
When running rsnapshot tonight it failed with a bunch of
cannot remove `file': Input/output error
errors.
I navigated to the directory and tried to delete it manually and I got the same errors. I tried with 'sudo rm directory'. How else can I delete this directory? What would cause a situation like this?
View 9 Replies
View Related
Apr 5, 2010
what is the best way to share visudo file without the need to use ldap.
View 3 Replies
View Related
Jun 20, 2010
Trying to split a wavpack on Ubuntu 10.04. I tried: Code: cuebreakpoints Disk3.cue | shnsplit -o flac Disk3.wv It gives an error Code: shnsplit: warning: none of the builtin format modules handle input file: [Disk3.wv] shnsplit: error: cannot continue due to error(s) shown above I already have wavpack 4.60.1-1 installed. Any ideas why shnsplit complains about not seeing wavpack?
View 4 Replies
View Related
Oct 28, 2010
I have a quirky situation whereby I'm using SED to selectively comment out a line in a crontab job (on Solaris, I know but it's connected to the Linux function I'm working with).
What's happening is this.
Remove hash symbol
Code:
/opt/csw/bin/gsed -i '/^.*/usr/local/scripts/mirror-fix.sh.*/ s/^#//' $TEMPFILE
Restore hash symbol
Code:
/opt/csw/bin/gsed -i '/^.*/usr/local/scripts/mirror-fix.sh.*/ s/^/#/' $TEMPFILE
The problem I'm running into is that the script can sometimes prepend an extra hash # symbol if run more than once (I have a lockfile that I poll for to discourage this, but that's not perfect).
I wonder how I can modify that sed statement to remove any/all leading hash marks up to the first other character, in this case it's a 0 (zero) which is a crontab file.
View 8 Replies
View Related
Nov 3, 2010
I have recently set up an ubuntu 10:04 based email server using postfix, clamav and squirrelmail. The setup works like a beast, much better than the old sco based system we were using. Anyway I work for a law firm, and we have use a bespoke case management system to complete work on cases. We have started a paperless office initiative. This means we are asking more and more clients and firms to correspond via email. This is where my troubles are kicking in. The governing body of solicitors in the UK is very picky, and we have to have certain formats and information in documents when sent out to clients, this is the same for emails.
I have a script that will cat the html header information, then cat the body of the email and finally cat the footer html information. The output of which is perfect and usable to the firm. My problem comes sending this file. The end of the script I have the following:
Code: mail -s $SUBJECT $CLIENTS_EMAIL < email.$$$ Pretty self explanatory. But when the email is sent from the mail queue its not delivered in html format but in plain text. Any email sent using outlook from any machine on the network can send and receive html email. How can I make this happen from the command line?
View 3 Replies
View Related
Nov 3, 2010
I want to itemize addition for each type of transactions. The example below is for 3 days,10/13/2010, 10/14/2010, & 10/15/2010.
PROD =89.25+89.25+104.47= 282.97
TAX =9.37+9.37+10.37 = 29.71
ETAX = 1+1+1 = 3
[code]...
View 8 Replies
View Related
Apr 13, 2011
I'm trying to write a bash script with a for loop that will perform two tasks a number of times depending on the number the user enters at the start. Here is what I got so far. It works fine the first time but then it just exits with no error msgs. The problem is in the way I have written the loop command. I have searched the web for examples to find out what I'm doing wrong with no luck.
#!/bin/bash
declare -i Num=1
declare -i Strnum=8
[code]....
View 3 Replies
View Related
Feb 9, 2011
I am using the package Quantum espresso to get electron phonon coefficients for monolayer graphene. While applying one of the executables, I got the error: "At line 356 of file q2r.f90 (Unit 51 "a2Fq2r.51") Traceback not availabel: compile with -ftrace=frame or -ftrace=full. Fortran Runtime error: bad real number in item 1 of list input
View 3 Replies
View Related
May 18, 2010
I have a document with page numbers in the Table of Contents in Roman Numurals. I would like to change them to numbers 1, 2, 3. How would I do this? I'm not finding any help on the Internet and in Openoffice help. If I change the numbers manually, they will revert back when I update the Table of Contents.
View 1 Replies
View Related
May 2, 2011
I have here a Network Monitoring tool that should monitor the Apache (httpd) 2.0 on CentOS 4.3, but I didnt have any background in using linux, I tried CentOS 5.5 with Apache (httpd)2.2 and it works, but whenever I tried it on Centos 4.3, it doesnt work at all, it has an error Testing on node localhost.localdomain: failed with Undefined status, Script execution failed. Input string was not in a correct format.
View 10 Replies
View Related
Apr 7, 2010
my school we want to print a magazine but we have problem with the format of the files. We need to create a sheet in A3 format from two sheets in A4 format. I was reading about the pdftk library but it doesn't do what i need.
View 4 Replies
View Related
Aug 29, 2010
I have been having a lot of trouble lately with installing from CD/DVD. The DVD reader/writer on this laptop is new. Nevertheless, trying to install Ubuntu onto an exernal HD, I get 'input output error on sr0 logical block (a large number) After a long time the booting proceeds to a point, but I never get the actual installation started, and have to shut down manually.
The CD is fine, says the Ubuntu-checker. I just installed using my sons laptop, and there was no trouble. Question: does this indicate a motherboard failure? A memory block damaged? Do you know of a diagnostic tool I can use to check the reading of a CD/DVD?
View 7 Replies
View Related
Jun 16, 2010
I would like to disable the option to format a hard drive on the drop down menu in computer. The reason being is that it is too close to the safely remove hardware option. I have one drive with about 15 years of stuff on it that I just use as a backup, and I don't want to accidentally hit the wrong button. What I was thinking of doing is going to that section of code and commenting that line out (that way I can just uncomment it if I want to format with the GUI tool). where can I find the code for that module?
View 9 Replies
View Related
Feb 24, 2011
My partition table is as follows:
sda1 - WinRE - Something Windows uses
sda2 - Windows7
sda3 - Data
[code]....
I need to remove Ubuntu 10.04 and so I therefore need to remove sda5 and sda6, right? Upon deleting sda5 in Gparted it tells me to "unmount any logical partitions having a number higher than 5".
View 2 Replies
View Related
Jan 7, 2011
ubuntu 10.10
I have a remote control (imon --> Harmony) that acts like a mouse. My goal is to remove that feature. Iam using lirc with Linux input layer (/dev/input/eventX) because Imon driver doesn't work at all. To get Linux input layer to work you need to choose the imon device.
Code:
cat /proc/bus/input/devices
Code:
I: Bus=0003 Vendor=15c2 Product=ffdc Version=0000
N: Name="iMON Remote (15c2:ffdc)"
P: Phys=usb-0000:00:12.1-2/input0
[Code].....
View 9 Replies
View Related
Sep 14, 2010
I have a WD external disk, NTFS file system. I mounted it on my Red Hat. While on the external disk, I deleted a directory, which was sent to .Trash-root of that disk.I went to .Trash-root and did rm -rf to completely delete that directory, but I got the following error: cannot remove `<directory>': Input/output errorWhen I do ls -la on that directory that I wish to remove, it shows me it has 0 files inside. But not only I can't remove it, I can't do anything else with it (copy, etc). And I have all the rights on that directory, so this isn't the problem.
View 6 Replies
View Related
Oct 31, 2010
Code:
cat ${SOURCE}/{start,universal,index,end}.txt > ${SERVER}/index.html
cat ${SOURCE}/{start,universal,02042010,end}.txt > ${SERVER}/02042010.html
[code]....
View 3 Replies
View Related
Apr 22, 2011
I am curious if perhaps I am doing something wrong extracting pages from a pdf doc using pdftk and creating a new file. I am only extracting the odd pages from the file and outputting them to a new file that is now only 20 pages instead of the input's 40 pages, yet the new output file is still 1.4Mb in size, the same as the original.
It seems strange to extract only half the pages of a large document and end up with a result that is the same size. how to streamline the resulting pdf's using pdftk?
BTW this is the command I am using, in case perhaps I am missing an option to optimize file size or something:
Code:
pdftk A=ch15.pdf cat A1-40odd output odd.pdf
View 1 Replies
View Related
Sep 26, 2015
I came to debian from fedora so there I used ( su - ) to become root user. So my question is that in debian, is it same using ( su ) and ( su - ) or here also using ( su - ) is preferred with slash or without slash. What is the correct and secure way in debian with full root status.
One more question relating gedit sources.list
I use as root account : gedit /etc/apt/sources.list (and then enter and sources file in gedit open)
Is this correct method or any other way as when save after changing entries inside it says error.
View 3 Replies
View Related
Jun 3, 2010
When I try to copy PDF files from one folder to another folder, it give me this error: "Error while copying "2004-SNUG-Europe-paper_...log_DPI_with_SystemC.pdf". There was an error copying the file into /media/CCDCE66BDCE64F70/Backup Master/Heterogeneous_cosimulation/Documentation" "Error splicing file: Input/output error" What is the reason of this error and how can this be fixed?
View 9 Replies
View Related
Jun 29, 2010
I have a 7.2 GB file (VMWare virtual machine file) that I am trying to copy from its original location to the another folder OR to external hard drive...each time I try to do this, I always get the following error after the copying process reach 'exactly' 1.4 GB
Error reading from file input/output error
And I have to either Cancel or Skip
I've tried to split the files to smaller pieces but the idea didn't work as I still get the same error whenever I try to compress/ split or do any operation with this file. how I can copy this file?
View 2 Replies
View Related
Sep 17, 2009
I'm looking for a way to insert the number of lines in a file to the start of the aformentioned file. This should be simple but as I am not used to scripts in Linux, I am finding it tough going. I can find the number of lines in a file easily enough via
filesize=$(awk 'END {print NR}' $1)
but as for inserting this into the first line, i'm failing to do so. I've tried some of the other approaches on these forums but none so far have been able to do so.
I've tried:
sed '1i$filesize' $1
but sed i requires a string, not a variable so no go I've also tried:
mv "$1" "${1}.bak" 2>/dev/null || touch "${1}.bak"
cat $filesize "${1}.bak" >"$1"
but again with no luck as cat seems to need an input stream Just to recap, i want to insert a line at the start of a given file that holds the number of lines the original file has.
ie the file:
a
b
c
d
e
should become:
5
a
b
c
[code].....
View 3 Replies
View Related
Nov 2, 2010
i want to replace
Code: <trus.analytics.platform.model.version>2.0.0-SNAPSHOT</trus.analytics.platform.model.version> with
Code: <trus.analytics.platform.model.version>2.0.0-b-20</trus.analytics.platform.model.version> using sed command. Code: sed -i
[Code]....
I think there is a problem with front-slash but not sure how to resolve it.
View 2 Replies
View Related