General :: Shell Script Has Stopped Working - Why Is "" Appended To Filename And Does It Matter
Jun 8, 2011
I am new to Linux, but was put in charge of our company's Amazon presence. My problem is that all of the sudden, a shell script we have been using has stopped working, and returned an odd error that I simply can't decipher. The shell script is pretty simple, and is run on our crontab (however manually running it causes the same error as well). The script name is "sendh.sh" and to run it in Linux is simply typing "sh sendh.sh". Here it is:
[Code]....
Yes, obviously those files are in the directory, I can see them through the "ls" command (or through WinSCP as well). When run one by one, each command works fine, it's just when using this "sendh.sh" shell script then it fails. Does anyone know why "" is appended to the filenames when I try to run it, or what the heck "ambiguous redirect" means?
Trying to write a shell script called make to read a file called dirs with the following in it programs scripts documents Read file line by line and make the directories in the current directory when you type ./make dirs if no file is given then program should print usage: make dirs filename
$ uname -a Linux a 2.6.35.10-74.fc14.i686.PAE #1 SMP Thu Dec 23 16:10:47 UTC 2010 i686 i686 i386 GNU/Linux $ lsb_release -a LSB Version: :core-4.0-ia32:core-4.0-noarch
[Code].....
How can I set a pattern that will output a filename equal to the original filename? E.g.
An external service I dont manage pushes mediafiles into a shared directory on my server. I need to move these files into their correct directories automatically. The problem is that if I run my script as a cronjob once every 3 minutes, I notice that the script copies files which are still on their way into my server. So I need to figure out how to have the script check that the files are complete (done downloading) before the script moves the files. This is what I got so far:
Code:
#!/bin/sh # Script by proximity 280709. # Locate correct directory
I am facing some problem with the mailx commmand. When i run the mailx command from the command line it sends it to the correct mail address which i mention.
But when i run the same command from a perl script, it appends the machine name (hostname.abc.com) to the mail address, and the mail address (sampleaddr@abc.com - which i entered) becomes invalid [URL] - found in the maillog), failing to reach the receiver. I am running it from the csh shell. how to avoid this addition.
how to update a series of values from multiple grep commands outputs to be appended to a single row of a csv file? Work on a linux envir. The values from grep output will be numeric values.
Output sold look like:
1,3,4,5,7,0,5
Each of these values will be odtained from multiple grep commands piped with wc -l Is it possible to update a single row of a csv file if so pleas ehelp me with the command to be used to redirect the output into the csv file
tail -f <filename> is not working as planned on my Ubuntu 9.10, it doesn't show the appended data.tail -F works, but it does not append the new line, it reopens the file with the message: "tail: <filename> has been replaced; following end of new file"
I have a laptop running Ubuntu 10.04 w/ wireless connection to desktop running Windows 7. I had it set up so I could execute a script to send a wakeonlan to the desktop. It worked fine for several weeks, but all of a sudden it stopped working. I've checked my script and it still looks good as far as I can tell. (I'm not that adept at script writing, so I wouldn't necessarily recognize a problem.) I've also checked the Windows machine to make sure the network adapter still is set to allow wake-on-lan.
BTW: my wake up script is as follows: #!/bin/bash wakeonlan xx:xx:xx:xx:xx:xx
Recently my wireless stopped working on my Debian testing system. It just doesn't connect. The best I get (only after a reboot) is that it says it did connect, but failed to get IP address. But usually it just tries to connect, disconnects straight away, connects again etc. so it never manages to associate correctly.
I am sure it did work about a month ago, stopped working after recent upgrades from the repository.
My fetchmail stopped working for gmail. These are the error messages:
Code: Mar 29 15:31:17 cannabis fetchmail[8814]: pop.googlemail.com fingerprints do not match! Mar 29 15:31:17 cannabis fetchmail[8814]: SSL connection failed. Mar 29 15:31:17 cannabis fetchmail[8814]: socket error while fetching from xxxxxxxxxx@gmail.com@pop.googlemail.com Mar 29 15:31:17 cannabis fetchmail[8814]: Query status=2 (SOCKET) Mar 29 15:31:17 cannabis fetchmail[8814]: pop.googlemail.com fingerprints do not match! Mar 29 15:31:17 cannabis fetchmail[8814]: SSL connection failed. Mar 29 15:31:17 cannabis fetchmail[8814]: socket error while fetching from xxxxxxxx@gmail.com@pop.googlemail.com Mar 29 15:31:17 cannabis fetchmail[8814]: Query status=2 (SOCKET)
I was on my server most the night via SSH doing changes (mostly permissions :/ ) and woke up this morning and get "Server unexpectedly closed network connection" from inside the network (via internal IP), AND outside the network (via outside IP)Obviously I messed something up somewhere right?
Any thoughts on what to verify or check first? Server is up, because I can access a few different hosted pages. I'm remote today, so I don't have access to the box. I'm assuming i'm SOL until I get to the box tonight to fix locally..
I've installed ethernet adapter, it is made in china from a manufacturer called FOX. The driver for that adapter is supported for sco linux kernel version 2.4.x and 2.5.x .However, I'm using Centos5 but the OS didn't recognize the adapter alone, so I'm trying to follo instructions on the driver on the attached CD.
The CD contains file named "SC92031.c", the instructions tell me to do the following "Compile the driver source files and it will generate sc92031.o"
My main PC has AN Athlon X2 4600+ on an Asus M2npv-vm. Has been working fine for ages running Ubuntu. Today it the system locked up and I had to do a reset. Since then it will not connect to the router or cable modem. I can connect another PC to the router, so that looks okay.
What can I do to test the network connection from Ubuntu? It's not even getting an IP.
I suppose it could be something has died in the hardware, but want to eliminate other possibilities first.
fsck died with exit statusAn automatic file system check of the root file system failed. A manual fsck must be performed then the system restarted. The fsck should be performed in maintenance mode with the root file system mounted in read only mode..This is the message I now get with the word "warning" in red
In a new PC I had constantly BSoD. I tracked it down to bad memory modules and took them back to the shop.Specifically the RAM was Corsair. Anyway they said they will do test on memory to confirm. They did tests and admitted the RAM was faulty and gave me a replacement. At this point: originally I bought 2 kits of 4G RAM. One of the kits turned out bad. They gave me a replacement, it does not seem to be exactly the same, though. In any case, I became causious and as soon as I got them I put them in the PC and run KUbuntu memtest. It started showing thousands of errors! (Again!). I removed the new kit and run the test again. No errors. I swapped the slots I put the memory modules and also no errors. I can not understand now. Is the new RAM kit bad or not? Does the slots I place the kits matter?
When originally installing 11.04 I had problems getting my Ralink 5390 wireless card to work.
Today my computer froze completely and I had to turn it off via the power switch. When I turned it back on, wireless was no longer recognized! My iPod can connect to the network just fine, so it must be an Ubuntu problem. There are no problems with my ethernet connection either.
I researched this and found several threads about blocking and unblocking wireless devices using the rfkill command. Well, unfortunately for me the rfkill command doesn't work. When I type sudo rfkill list or sudo rfkill unblock all, nothing happens; it just returns me to my bash prompt. I even tried uninstalling and reinstalling rfkill...nothing.
How can we convert a dynamic library (filename.so) to a static library (filename.a) using gnu gcc . Can we get a static library form a dynamic library . I saw a few post in which the conversion form a static library to a dynamic library is mentioned but, unfortunately, not the other way.
i am now in the process of building gnome shell.it says 3 or 41 currently and with the net speed today, i think it will take ages till it gets completed. is there a way to stop midway so i can rest my laptop and resume later from where i left out ? an early reply will help me decide whether to go ahead or stop and forget building it today !
I am having a problem with two linux boxes I have. They are running Centos 5.3 and Centos 5.4. The problem is that when I log in, this file /etc/host, under the etc directory get appended the username I am logging in as, the IP address I am logging in from, and worse, the password in clear text.This is the format it uses:username@IP (password in clear text) [Tue Jan 12 2010 13:00:26 -0500]Is it possible for someone to tell me what is this about, and how to stop it?
If I interactively ssh to a remote host and enter commands, I can up-arrow through the command history.If a script ssh's to a remote host and calls a command, it does not get appended to the history.How can I configure ssh or sshd so that this happens? I'd like to be able to have those scripted commands available in the history file when I log back in interactively.
.site gets appended to the end of the hostname every system bootup for me (e.g. hostname.site), even though I've changed the hostname in both the Network Settings and Hostnames sections of YaST. How can I stop this?