General :: Cd Error From For Loop?

Nov 10, 2010

./test.sh: line 3: syntax error near unexpected token `cd'
./test.sh: line 3: `cd $f'
--------------------------------

[code]....

View 1 Replies


ADVERTISEMENT

General :: Syntax Error In If Loop?

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

General :: For Loop Or While Loop To Read The Fields Of A File?

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

Ubuntu :: Mount -o Loop - Flash BIOS Error "Intel UCode Loading Error" - Make Iso Images Bootsble From The Harddisk

Feb 19, 2010

I need to flash my BIOS to get rid of an error: "Intel uCode loading error". On [URL] I have found a tutorial, that looks to be fine. I can even see in the comments, that somebody have done this with success from Ubuntu 9.04, the very same system, that I use. Nevertheless I cannot make this bootCD with my Ubuntu 9.04, as it doesn't know the loop option to mount the image.

In the tutorial it says: "Requirements for this step is that you have support for the vfat and loop file systems in the kernel. Or you can have those features compiled as modules. In the latter case you can load the modules before the next step, like this:

modprobe vfat
modprobe loop"

loop doesn't seem to be present in my system, and the command modprobe loop returns an error that the module is not available. I tried to follow the tutorial anyway, but with no success. How can I get the module lopp? I also want to use it to make iso images bootsble from the harddisk.

View 2 Replies View Related

Programming :: Error Codes In A For Loop

Nov 3, 2010

I've got a 'nested' for loop which has a grep in it, if the grep fails there's no output - however the error code is still $0 and the second for loop is still entered, there's also a grep in the second for loop.I guess ultimately what i need to know is whether there's a way of making grep generate an error code. when no results are found?

View 14 Replies View Related

Ubuntu :: Loop Device Error When Shutdown Since Upgrade To 9.10

Apr 6, 2010

When I shutdown, I have a black screen with a message of I/O error, loop device... And the computer doesn't complete to shut down. This problem appear since I upgrade to ubuntu 9.10.

View 1 Replies View Related

Hardware :: Endless Loop Giving Error While Trying To Image Disk

May 11, 2011

recently my HP Pavilion's Western Digital (WD2500JS) HDD has begun failing (bluescreens, slow, etc...). I was able to attach it to another computer using a IDE to USB adapter and save my personal files (pics, music, etc...), so the drive has not yet completely died. So I bought a SATA Seagate Barracuda 500GB HDD and wanted to use my restore discs that HP made me purchase off of them to reinstall my Windows Vista Home Premium Edition, which OF COURSE didn't work. So after researching a bit I found the best idea would be to make and Image copy of the original HDD and put it on the new one. So I tried using Clonezilla which ran in an endless loop giving error after error for hours while trying to image the disk. Fortunately my work has a ImageMASSter 4004i which is a piece of hardware that does a direct, drive to drive image from the Master drive to the destination drive.

But unfortunately this didn't work either. It was telling me that their was an error within the destination drive, something like "0x84 URMWT Sequencer failed to complete". Does the drive need to be completely empty?Should I reformat it before I try this (if so which FS?)? I plugged it into my laptop with USB to SATA adapter and was unable to mount it (this was after I had it in the Imaging Hardware Device, not sure if that could have screwed something up). The strange thing is that the last couple of days the new drive did work, I was using it for temporary storage of some files.

[code]...

View 11 Replies View Related

Ubuntu :: Mount Iso File - ERROR: Modinfo: Could Not Find Module Loop

Dec 4, 2010

I'd like to mount an iso file ,however, it failed as following: ljk@ljk-laptop:~/Test$ modinfo loop ERROR: modinfo: could not find module loop what I can do?

View 1 Replies View Related

Software :: Sarg 2.2.5 Can't Generate Report - Error: Getword Loop Detected?

Jul 23, 2010

I am getting an error when i generat a report with squid's report generator ( sarg )is there a tool or way that i can find where in the log file the error is, the log file is 61442 lines, and it's gonna take me forever to find the error,

View 1 Replies View Related

Programming :: Shell Scripting Loop Error Yal2361: Command Not Found?

Jul 22, 2011

I have written the following script in my linux server to add users for LDAP database.But i can't able to run this.

The script is as following

#!/bin/bash
echo "Mention the username which you want to convert LDIF format"
read username
if ["$username" -e "/ldiffile/passwd"]; then
echo "Username already exists"
else
cat /etc/passwd | grep -i "$username" >> /ldiffile/passwd
fi
The output which i got :
. ldapadd.sh
Mention the username which you want to convert LDIF format
yal2361
-bash: [yal2361: command not found

please let me know where need to change and what

View 5 Replies View Related

General :: Bash For Loop Not Working?

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

General :: Using 'find' And 'grep' In A For Loop?

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

General :: Cannot Add Fractions In Loop Using Bc In A Script?

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

General :: Shell Programming Using While Loop

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

General :: Loop Detected When Resolving The Name From Dns?

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

General :: Getting The While Loop To Execute In The Ssh Command?

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

General :: Convert An Animated GIF (only Two Pics In Loop) To FLV / AVI?

Jan 31, 2010

Do you know how to convert an animated GIF (only two pics in loop) to FLV or AVI?

I didn't search for a Microsoft alternative that maybe could run with WINE, because I really prefer a native one; also a java version will be fine.

View 3 Replies View Related

General :: How To Break A Symbolic Link Loop

Feb 2, 2010

While I was trying to compile a C shared object library, I accidentally created two symbolic links which point to each other. Is there a way to get rid of them without nuking the whole directory? I read that the only way to break a symbolic link is to delete the file it points to, but I'm sure there must be another way.

View 3 Replies View Related

General :: Can't `mount -o Loop` An ISO From An NFS Share (RHEL)?

Jun 16, 2010

I have a large NFS share with a variety of software ISOs on it. I've only tried this on Red Hat Enterprise Linux, but when trying to do the following, the mount comes back with an error indicating no permissions to mount. Why would this be happening?NFS is mounted thusly:mediaserver:path/to/isos /media/nfsThis is the mount call that failsmount -o loop /media/nfs/product.iso /tmp/productIf I copy the ISO, there is no issue. The NFS share is mounted rw.How can I loop mount the ISO from the NFS share without copying it first?

View 2 Replies View Related

General :: Convert An Animated GIF (only Two Pics In Loop) To FLV Or AVI?

Jul 31, 2010

how to convert an animated GIF (only two pics in loop) to FLV or AVI? I didn't search for a Microsoft alternative that maybe could run with WINE, because I really prefer a native one; also a java version will be fine.

View 1 Replies View Related

General :: Redirect From A File Into An Actual For Loop?

Apr 11, 2011

I multi-boot several Linux distributions with an assortment of additional data partitions. I get frustrated whenever fsck is forced during boot. (It ONLY happens when I'm in a hurry don't you know...) So I wrote a script to automate forced fscking when I do have the time. (And/or while I'm doing something else in another workspace.

Because I multi-boot, I've learned that udev doesn't always assign the same device name to each drive for all distributions. I've had the same partition identified as hda5, sda5, & sdb5 by different distributions (without doing anything to affect the boot order) So my solution is to keep a list of partitions in a specific file on each distro with valid device names according to that distribution's udev process. Actually I'd use LABEL= instead but the labels don't show up in /etc/mtab, and I like to make sure a partition isn't mounted before I try to fsck it.

I can make this work in a for loop using cat. But I've seen so many things about NOT using cat that I wanted to rebuild my script. I can make this work with a redirect instead of cat via a while loop, But I "LIKE" old style for loops. But I can't seem to find a way to make a redirect work with one. I thought this might make a good first �LinuxQuestions.org� question. I'm also open to any other suggestions on better/alternative methods... Is it possible to redirect from a file into an actual for loop?

My script is as follows:

Code:

#!/bin/bash
# FsckEm I script to force file system checking on unmounted ext2/ext3/ext4
# partitions in preselected list. FsckEm accepts no options. Partition

[code]....

View 5 Replies View Related

General :: Recursively Browse Subfolders In A For Loop?

Feb 19, 2010

I wrote a script for copying mp3 files to my girlfriend's mp3-player and it looks like this:

Code:
mount /dev/sdc /test -o sync
for i in *.mp3; do

[code]...

View 13 Replies View Related

General :: Write A Loop Command For Pdf2djvu?

Jun 25, 2011

How do I write a loop command to periodically check a given folder and then create a djvu file from any pdf it finds.pdf2djvu works great but I'm looking to set up a "hot folder" for general office staff to use.

View 3 Replies View Related

General :: Loop Through A DIR To Delete Files By Inode

Feb 9, 2010

I have a directory that contains some files (over a 1,000) that have a '' in the filename. There are also some good files that I need to keep. therefore I need a script to delete based on inode.

What I have thus far:
list="$(ls -il /opt/PC/log/*RPOUT*.xml)" #this gives me the list
# I need to get the inode of.
for i in $list
do
find . -inum $i -exec rm -i {} ;
echo "delete file" $i >> /home/me/tmp/del_inode.txt
done
echo 'completed'

I know this is not right ... what I know is is the 'find' is. I need to loop through the $list gleaning inodes to get all the files with '' delete. I'm not sure how. The $i gives me the whole line. I just want the first position. set $() does not seem to work ...

View 5 Replies View Related

General :: Grep Extended Regez In For Loop?

Jun 3, 2010

I'm trying quickly dig through our VPN logs for a list of class A ips , and I'm having trouble. I have a file with a list of numbers, one per line. I'm wanting to incorporate each number into an extended regex:

Code:

for i in `cat ips`; do zgrep -E '[[:space:]]$i(.[0-9]{1,3}){3}[[:space:]]' vpn1/2009.08.20.log.gz; done

If I substitute one of the numbers in for $i, it works for that number. For example:

Code:

for i in `cat ips`; do zgrep -E '[[:space:]]58(.[0-9]{1,3}){3}[[:space:]]' vpn1/2009.08.20.log.gz; done

I think the loop is passing literally "$i" to zgrep instead of its value due to the tics, and I can't figure out how to resolve this. I can't remove the tics b/c zgrep doesn't like that. Putting a backslash in front of $i doesn't work.and the number loop seems to be working fine:

Code:

for i in `cat ips`; do echo $i; done
1
14
27
43

[code]....

View 3 Replies View Related

General :: Bash Infinite Loop Haunting?

Mar 17, 2010

I want to figure out what is going on in this small script.Its really strange.I think its the infinite loop again.All I want to do is to collect some data from the zenity dialog box in an array and then echo it.Here is the code

Code:
#!/bin/bash
#export PS4='+${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: ' debugging info

[code]...

View 5 Replies View Related

General :: Bash Script - Stops After While Loop?

May 13, 2010

Totally new to programming (as of this morning) so please bear with me I have a bash script that stops working after the first while loop.

#part 1
While
doThisThatThe Otherdone
#part 2
While
doMOreMoreMoredone

Every arguement above the first loop completes (including the first loop itself) but anything below (incuding the second while loop) doesn't finish. I know that it isn't a problem with an unending loop... it seems to be something about the While loop that I'm not understanding... but I can't figure it out. I just need arguments below the first while loop to take place.

View 7 Replies View Related

General :: Feeding A While Loop With A Command Output?

Apr 25, 2011

I am posting this just for the sake of curiosity. I am trying to feed a while loop structure with a command output, but using the bash built-in I get the error "ambiguous redirect":

Code:
while read line
do

[code]....

View 4 Replies View Related

General :: Kubuntu KDE Wallpaper Loop Glitch/Bug?

Mar 31, 2011

I tried installing a wallpaper and it said that I would have to open up a web browser to view it, but when I did it launched over and over again, and I couldn't even properly shutdown, I had to hold down the power button. But it seems fine now, but from now on I'm avoiding downloading Wall Paper that requires you to use a web browser to view and download.

View 1 Replies View Related

General :: Need For Loop To Get Dirs And Run Bash Script

Jul 7, 2010

I have to format 4 years worth of awstats data "static" for a client and then move it to their new server.I don't want to run the commend to do this 48 times. If possible I would like to use a bash script that uses the folders in a directory so the script knows which year-month to do this for me and which folder to place the output in.

View 5 Replies View Related







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