General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies


ADVERTISEMENT

General :: Send The Output Of Send Command To A File?

Jan 20, 2011

in the middle of script, i need to send the output of (send command on line 8) to a file

#!/usr/bin/expect
spawn telnet 172.20.64.133
expect "ENTER USERNAM <"

[cod]....

i treid the below on line 8 :

1- send "show command;

" > logfile.txt : gives an error extra character after the "

2- logsave logfile.txt 'send "show command;

" ': error invalid command

3- i simply tried to send the output of the whole script to file logsave /home/logfile ./script : seems that logsave work under root only

4- ./script > logfile : the problem with this is that the output of echo or (read "enter your id") command will not be displayed on the screen (actually nothing will be displayed, i have to open the log file to see the output). is there any way to save the log of the "send" ? or to save the log of the complete script without hiding the output on the screen?

View 2 Replies View Related

Ubuntu :: Pdftk Output File With Pages Extracts Same Size As Input File?

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

Ubuntu :: Error (splicing File: Input / Output) While Copying File

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

Ubuntu :: Copying File - Error Reading From File Input/output

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

General :: Send Output To Both The Screen And A Txt File?

Jan 29, 2010

I am currently using this command

Code:

apt-get install samba --force-yes -y > /sambainstall.txt This suppresses the screen output and sends it all to a text file, how do I have both?

View 2 Replies View Related

General :: File Really Is After The Command 'file' Output "data"?

May 3, 2010

I download some movies those are with 'mkv' , but couldn't be played, I tried other players , like mplayer , dragon , xine, even swich OS to windows , didn't work . not all of those files , but some of them. one of them named 'the.other.man', 2GB.I opened a terminal and executed "file the.other.man.mkv "utput is "data", and command 'strings the.other.man.mkv", output like as follow:

T5}.
S!e
I|

[code]...

View 1 Replies View Related

General :: Send Data Through A USB Port To A Printer Which Recieve Text File?

Jul 7, 2010

I am trying to send data through a USB port to a printer which can recieve text file. Now to send the data to the printer I am doing echo "Hello World" > /dev/usb/lp0

but the data doesnt seem to be sent to the printer because I have an analyzer to monitor the data sent to the printer. Is there anything else which I need to do

View 1 Replies View Related

Server :: NFS Large File Copies Fail - Error Writing To File: Input/output Error?

Jun 27, 2009

I recently upgraded my file/media server to Fedora 11. After doing so, I can no longer copy large files to the server. The files begin to transfer, but typically after about 1gb of the file has transferred, the transfer stalls and ultimately fails with the message:

"Error writing to file: Input/output error"

I've run out of ideas as to what could cause this problem. I have tried the following:

1. Different NFS versions: NFS3 and NFS4
2. Tried copying the files to different physical drives on the server.
3. Tried copying the files from different physical drives on the client.
4. Tried different rsize and wsize block sizes when mounting the NFS share
5. Tried copying the files via a different protocol. SSH in this case. The file transfers are always successful when I use SSH.

Regardless of what I do, the result is the same. The file transfers always fail after approximately 1gb.

Some other notes.

1. Both the client and the server are running Fedora 11 kernel 2.6.29.5-191.fc11.x86_64

I am out of ideas. Has anyone else experienced something similar?

View 13 Replies View Related

General :: Read Data From Text File And Output Into A Table?

Apr 12, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings.he extracting of the data is fine, but creating a table i'm having problems with. I think it is possible to do it using the awk function, but so far i'm having a lot of difficulties.

View 14 Replies View Related

Fedora :: Cannot Remove `file': Input/output Error

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

Ubuntu :: Cannot Open File: Input/output Error

Nov 11, 2010

I just received a 1TB external(Western Digital) hard drive(NTFS) for backup purposes. I'm using an Ubuntu Live CD, and an external hard drive dock. I am transferring over esata and am receiving the error:

Code:

Cannot open file: input/output error

Seems strange that it said "open". At any rate only about 60 of the 200+ GB were able to be transferred over...this won't do. I have tried to copy via CLI using

Code:

cp -r

and received the same issue. For clarification I am attempting to transfer from a mounted partition onto the mounted external.

View 2 Replies View Related

Ubuntu :: Canot Remove File Input/output Error

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

Ubuntu Multimedia :: Creating ISO File In Terminal - Input / Output Error

Feb 15, 2011

I'm trying to create an iso file in a terminal with the following command:
$cat /dev/sr0 > nameofdisk.iso
I get the following error
cat: /dev/sr0: Input/output error
I already checked and my optical drive is indeed /dev/sr0. I've hunted google a few hours trying to figure it out. Does anyone know why I'd be getting this error?

View 4 Replies View Related

Programming :: PyGTK: Send Output From A File Descriptor To A Textview?

Jul 22, 2010

Within PyGTK I'm using gobject.spawn_async to launch a bash script. I would like the output of that bash script to be displayed within my application. I have a textview set up to receive the text ...

Here are the commands that launch the program:

Code:
def run_command(command):
global keep_pulsing
keep_pulsing=True
(cpid, cstdin, cstdout, cstderr) = gobject.spawn_async(command,flags=gobject.SPAWN_DO_NOT_REAP_CHILD|gobject.SPAWN_STDERR_TO_DEV_NULL,standard_code....

Here are the two callback functions. But like I say ... I have no idea how to get that data from the 'cstdout' file descriptor into a textbuffer.

Code:
### THE FOLLOWING ARE GLOBALS:
textview = wTree.get_widget('textview1')
textbuffer=textview.get_buffer()
def update_textview_callback(fd, condition):
global keep_pulsing
if keep_pulsing:
progressbar.pulse()
code....

View 3 Replies View Related

Programming :: Using Piped Data As Input - Cannot Stat '-': No Such File Or Directory

Nov 6, 2010

Code: stuart@stuart:~/$cat showthread.php.html | grep -o [URL][^"< ]*" | uniq | head -n3 | plowdown - cannot stat '-': No such file or directory Code: stuart@stuart:~/$ awk NR==$x Musiclist.txt | cut -d/ -f6 | basename $1 .mp3 .mp3 Here's some system info on the bash i'm using:

[Code]...

View 13 Replies View Related

Ubuntu :: Output Data From Text File Into A Table?

Apr 13, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings. The extracting of the data is fine, but creating a table i'm having problems with. My code extracts the data outputs the string to another file which works fineThe text file looks like this

mr smith 1 purchase oct 2007
mrs smith 2 purchase nov 2006
i want it to look like this

[code]....

View 7 Replies View Related

Ubuntu :: Send Email Using Evolution - Could Not Connect To Smtp.gmail.com: Input/output Error

Sep 19, 2010

for like two weeks I have been trying to send email using evolution for some reason I always get the same Code: Could not connect to smtp.gmail.com: Input/output error

View 6 Replies View Related

Ubuntu :: Data Could Not Be Written (Input/output Error)

Oct 18, 2010

i tried to rip a dvd last night and it got 98% done then said "Data could not be written (Input/output error)"here is the error log from brasero

Checking session consistency (brasero_burn_check_session_consistency brasero-burn.c:1744)
BraseroDvdcss called brasero_job_get_action
BraseroDvdcss called brasero_job_get_action

[code]....

View 2 Replies View Related

General :: Script To Ftp A File To Remote Machine - Log The Output To A File?

Feb 5, 2010

I am using below script to ftp a file to remote machine

Code:

#!/bin/bash
ftp -nv <<EOF
open ${SERVER}

[code]....

When I execute the above file its working fine and displaying output on to the screen. How can I log the output to a file?

View 7 Replies View Related

General :: Make Arithmetic Operation Of Data File With Script File?

Aug 31, 2010

I wonder how to arithmetic operation of our data file using any script program/command (like sed, cut,awk)for example my data.file is:

45 65 42
12 23 61
43 34 21

I want to multiply first column with 2 and add second column with 3 then it become

90 68 42
24 26 61
86 37 21

View 5 Replies View Related

Ubuntu Installation :: Copying Data Setup Tells About An Input/Output Error?

Dec 20, 2010

I want to install Xubuntu 10.10 x64, but it does not work. While copying data the setup tells me about an Input/Output error, but i don't think there are hardware errors.

The environment:

AMD Phenom II 1055t 6x2,8 Ghz
2x 2gb ram
Hitachi 1TB hard drive
Two partitions: 1st for Windows 7 Ultimate (NTFS), 2nd for my Data (NTFS)

So I decreased the size of the data partition and created two new partitions beside the Win7 partition and the data partition. The first is ext4-journal (20gb) the second is Swap (4gb). I've done that all by the Xubuntu setup.

I've downloaded the image from the german mirror (TU Chemniz) and checked the integrety via SHA1. Checksum was correct. I also checked the data after burning.

View 4 Replies View Related

General :: Get Output File From A Master File?

Aug 3, 2010

having following problem in linux environment.I have a following basic file with name " BASEFILE", as shown example below :

sl.no pol.no name status loan
1 123 rama FORCE 500
2 234 jama LAPSE 800

[code]...

View 12 Replies View Related

Programming :: Send The Output Of A Command In A File Defined By A Eval $"$var1"?

Jul 7, 2010

Here is the block of code : (The red part is the code that doesn't work) The file is not created and see the output after the code. # i loop create environment structure and k loop create std procedure sub structure.

for i in TRAX2 TRAX BENCH PROD
do
eval mkdir $"acsayul02501_${i}"
eval chmod 2770 $"acsayul02501_${i}"

[code]....

View 3 Replies View Related

Programming :: Splitting A File Based On The Values Read From An Input File?

Jul 27, 2010

I am splitting a file based on the values read from an input file. The below one is the script.

1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).

2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?

for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done

View 2 Replies View Related

General :: Getting Input From A File?

Dec 2, 2010

I am trying to input from a file. The file's layout has three columns; a department number, a first name and a last name, each separated by a space, for example:

Code:

781-89-4271 Amy Balduff
839-98-4072 Brian Becker
846-43-4284 Christina Brendon

[code]....

I need to input the words through separate variables because I will be passing them to other programs as soon as I can figure this out.

View 9 Replies View Related

OpenSUSE :: Recover Data Form Old 5.25 Floppies - ERROR: Cannot Read `/dev/fd0' (Input/output Error)

Mar 15, 2010

I don't know the format of these old floppie disks, ive tried

Code:

PC8-248suse:~ # file -s /dev/fd0
/dev/fd0: ERROR: cannot read `/dev/fd0' (Input/output error)

how i can go about reading this data?

View 9 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

Programming :: Sed - Save Output To File With Filename From Content Of Another File?

Feb 28, 2011

My employer issues pdf files with everyones work schedules. I copy the content and save it as plain text in a file called unformatted (hope to be able to automate this step someday). Im working on a SED script that reduces unformatted to only display what I want to see and saves the result in a file Iïve named formatted. After that I have to manually copy formatted and save it with that days date as a filename e.g. 2011-02-25 or whatever day is scheduled in the pdf, for use on a mobile device (Nokia N900). I noticed that the date occurs on certain lines in the file so I added a line like:

sed -n 's/^Date: (201[1-9])/([0-1][0-9])/([0-3][0-9]).*/1-2-3/p' < unformatted >theDate
That creates a file theDate with the date in it that I wish to use as the filename for this particular instance. So I would like to skip the file formatted all together and have the sed- script write to a new file using the content of the Date as a filename, but how do I make that happen? And of course it would be more elegant if I could skip the intermediate theDate file as well.

View 4 Replies View Related

General :: Input To Sudo - What Is Its File Descriptor

Aug 5, 2011

Where does input to sudo go? I mean when we give password to sudo prompt where it actually goes? If it goes to a file what is its name or what is its file descriptor?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved