General :: "read" Is Reading Info From While Loop?
Feb 10, 2011
I'm trying to prompt the user to enter Y or N in the middle of a while loop, but the read command is simply drawing in the next value.I'm reading from a simple file full of words (one per line)
Code:
while read line
do
[code]....
View 1 Replies
ADVERTISEMENT
Sep 1, 2010
I have a mytext file with month and year as two separate fields. likemytext fil
08 2010
09 2010
10 2010
........
........
........
I want to read the values of each field i.e., month and year into an awk script.
View 10 Replies
View Related
Nov 17, 2010
been playing around making a server to play some games on running centos 5.5
what ive spent a while looking for (a few days) is a way to make a file which i will call startup this will contain some values
Code:
mod_directory="etpub"
port="27960"
log_name="console.log"
vm="0"
dedicated="2"
[Code].....
View 1 Replies
View Related
Nov 16, 2010
I am trying to find a linux cmd line utility that will read info from an iso file. The problem I have is that the file is always corrupt so I cannot mount it because I only have around 100k of it but all I need is to extract the headers of what the iso contains. how I can achieve this I have searched the internet with no look at all.
View 1 Replies
View Related
Dec 12, 2010
I am porting the kernel on my hardware board...dmesg shows that...
mmc0: mvsdio driver initialized, lacking card detect (fall back to polling)
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address aaaa
[code]....
View 14 Replies
View Related
Jun 20, 2010
When I add the line (sleep 5 ) & in the script then the "while read" loop does not read all lines from the file, but only prints the first line.But when I remove the ( sleep 5 ) & from the script, then the script prints all lines as defined in the file.And how to solve the problem? I want to create a new process (for which the sleep is just an example) in the while loop:
$ more test
#!/bin/ksh
while read -r line ; do
[code]....
View 1 Replies
View Related
Apr 25, 2010
ITT and am just lurning about scripting and need to read a file and output the file to the screen. We need to do this with a while loop.
View 5 Replies
View Related
Sep 2, 2009
When I update my system by KpackageKit I have the ability to read what was fixed by that package update by clicking on package's name. How to read this info in command line by yum?
View 4 Replies
View Related
Mar 26, 2010
I am trying to read the names of hosts from a file and do a ssh to see if processes are all running or not.
Here is the outer loop that is causing problem:
hosts.lst is a text file that has the host names in each line.
The problem is that the loop just breaks after the first run. Somehow while read line becomes invalid when the body of the loop does the ssh and returns.
View 5 Replies
View Related
Mar 4, 2010
I have spent some time in photoshop. And I remember a useful feature in it, where Photoshop can tell you info about the image, by pressing on the properties or something. Photoshop can say what the picture was taken with (mobile / camera) and what date.
I run Ubuntu now is there anyone who knows a program which can do the same for Ubuntu? I can't find anything in GIMP
View 8 Replies
View Related
May 4, 2011
I don't understand the results of a simple performance test I ran using two basic scripts (running on a high end server):
perfVar.zsh :
#!/bin/zsh -f
MYVAR=`cat $1`
for i in {1..10}
[code]...
Performance test result:
> time ./perfVar.zsh BigTextFile > /dev/null
./perfVar.zsh FE > /dev/null 6.86s user 0.32s system 100% cpu 7.177 total
> time ./perfCat.zsh BigTextFile > /dev/null
./perfCat.zsh FE > /dev/null 0.01s user 0.10s system 91% cpu 0.118 total
I would have thought that accessing a VARIABLE was way faster than reading a FILE on the file system... Why this result ?Is there a way to optimize the perfCat.zsh script by reducing the number of accesses to the file system ?
View 3 Replies
View Related
Mar 4, 2010
Well, I am facing one issue:How can i read two files word by word at a time using any loop as i need word by word comparision in shell script?Please let me know pseudo code.
View 14 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
Mar 5, 2010
I have an application where I am sending data via serial port from PC1 (Java App) and reading that data in PC2 (C++ App). The problem that I am facing is that my PC2 (C++ App) is not able to read complete data sent by PC1 i.e. from my PC1 I am sending 190 bytes but PC2 is able to read close to 140 bytes though I am trying to read in a loop.Below is code snippet of my C++ AppOpen the connection to serial port
Code:
serialfd = open( serialPortName.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
if (serialfd == -1)
[code]...
View 5 Replies
View Related
Jul 21, 2010
I plugged in my USb drive into my computer yesterday and tried to delete a folder. I was unable to do so and got the following message
Cannot move file to trash, do you want to delete immediately? The file "my file" cannot be moved to the trash. Show Details Unable to create trashing info file: Read-only file system
So when I click on delete I get another error message:
Error while deleting.
There was an error deleting Case Study Database. Show Details Error removing file: Read-only file system
At this point I can only click on Skip, Skip All, or Cancel.
I have not changed anything on the stick recently so I dont know what is causing the problem.
View 7 Replies
View Related
Mar 10, 2010
I down loaded Debian 5.0.4 and burned it to CD (several times I might add till it was right) and now the computer I'm putting it on wont acknowledge it as a boot disk and load. It does not have a problem with my windows cd, which has a crack and the start of all my problems, But not the Debian CD-1 disk. what now? The computer is an IBM thinkpad a22p. Everything works as far as I can tell. But I was going to reinstall Windows and failed in that because of a small crack on the edge of the disk that stopped the install and any hope of accessing the file on the laptop. Microsoft does not support windows xp any longer, you must buy windows 7, but the ibm will not run it due to processor speed and ram limitations. But it will run linux and I'm willing to try it just to get out of microsoft control.
Idon't know what else to do. This is the link to where I downloaded the software ( [URL] ). The others five that i downloaded were on the same page that I got this one. Are there bad files here? Is there a missing file in the disc?
View 4 Replies
View Related
Dec 23, 2009
I want to read the hardware info from my cd-rom drive. It's actually a hd-dvd drive, but has no stickers or anything on it. I want to read its flash from the command line. I don't know if the "flash" is exactly what I want to read, but whatever displays its info.. model, serial, that stuff. (final goal being - I want to see if I can flash it to read blu-ray, but I need to figure out what drive it is first!)
View 2 Replies
View Related
Aug 6, 2010
so i cannot install anything because update-info-dir file is missing from /var/lib/dpkg/info/ .. I've searched for the last day and a half for a way to fix this, but nothing. can't even update dpkg because of this. so how do I bypass or fix this so I can install stuff (this is a fresh install of ubuntu 10.04 lts Lucid Lynx).
View 9 Replies
View Related
May 20, 2010
i installed kernel 2.6.34 to fix my lid closing issue, and that went great. but now when i go to reinstall my broadcom i get this error. Code: Reading package lists... Done Building dependency tree Reading state information... Done bcmwl-kernel-source is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. 1 not fully installed or removed. After this operation, 0B of additional disk space will be used. Setting up bcmwl-kernel-source (5.60.48.36+bdcom-0ubuntu3) ... Removing old bcmwl-5.60.48.36+bdcom DKMS files...
[Code].....
View 9 Replies
View Related
Jul 16, 2011
I want my samba to keep my windows attributes exactly what the user setted in windows I mean if it has read only file in win box and copy it to samba share ,samba keep it read only and same for other attributes but it does not do it now with my configuration:Quote:
[global]
workgroup = DOMAIN
server string = File Server
[code]...
View 3 Replies
View Related
Nov 10, 2010
./test.sh: line 3: syntax error near unexpected token `cd'
./test.sh: line 3: `cd $f'
--------------------------------
[code]....
View 1 Replies
View Related
Feb 4, 2010
What are the possible problem when Windows access the file from Ubuntu got Read Only even though have a full permission to read, write and execute the file? Ubuntu to Ubuntu accessing the file there is no problem only Windows got a problem.
View 1 Replies
View Related
Mar 7, 2011
I have a requirement to check the following conditions..If my folders are not A and B then list files in the directory else no listing the filesso my if loop is some thing like this.
Code:
if [ $dirName = "C" && $dirName != "A" && != "B" ] then
ls -la
[code]....
View 1 Replies
View Related
Apr 21, 2010
I have bash 4.0. I used the following for loop example, but all it outputs is "{1..10} instead of the actual numbers one through ten. why?
Code:
for a in {1..10}
do
echo -n "$a "
done
View 5 Replies
View Related
Mar 23, 2011
I have a server hosting 100+ websites. I need to quickly identify which websites are configured with a database. There are way too many to manually check every website for a PHP file with a database name. So, I created a list of all databases from MySQL and put them in a text file. I then exported the text file to a shell variable and used it in a for loop.
bash variable
Code:
DBLIST=`cat dblist.txt`
Example of $DBLIST
Code:
db1 db_testing2 database_clientname production words4cheap
for loop
Code:
for db in $DBLIST; do find . -type "f" -iname "*.php" -exec grep -i $db '{}' ; -print; done
Note: my find statement starts searching at . which is the directory that contains all of my websites and their data, each website is setup in a sub directory, identified by it's domain name.
Example: I'm in /var/www. Beneath /var/www are a list of directories:
[URL]
However, this is taking too long (it's been running most of the day) and I was wondering if there wasn't an easier way to accomplish what I'm trying to achieve?
View 4 Replies
View Related
Feb 11, 2010
i have tried a lot to add floating values in while loop using bc, but no sucess!!!
script is :
read a1
read a11
[code]....
View 5 Replies
View Related
Jun 28, 2010
I am trying to do some shell programs. I tried some sites regarding the while loop, they give the structure as:
Code:
while [ n1 -lt 500 ]
do
echo $((n1+100))
done
But the below code also worked for me:
Code:
while ((n1 > 500))
do
echo $((n1+100))
done
By using (( )) I could use while, for. But the documentations didnt follow this way. I mainly use this for datastructure programming.
View 4 Replies
View Related
Apr 26, 2010
The problem of loop detected when resolving the name from dns.Why the problem of loop detected comes when name is resolving from dns.
View 4 Replies
View Related
Jun 15, 2011
I am having trouble getting the while loop to execute in the ssh command:ssh $USERID@serverX "while read line do echo $line done<$list_dir/cost_feed.lst.old"Error:bash: -c: line 1: syntax error: unexpected end of fileI have managed to use simpler commands with ssh like:ssh $USERID@serverX "pwd; cp x y"I expect that I need to add some combination of escape characters or semicolons
View 3 Replies
View Related
Jan 26, 2010
I have a linux hard drive that I can plug into an external USB interface.. how do i read from this? from windows it only shows it as a unpartitioned drive
View 4 Replies
View Related