Cis 140 student.how to use the test command to evaluate whether the shell variable I create contains a referance to the bash shell? and use the echo command to determine the result.
I am interested in the following problem: given a string (pattern) find a regexp which match this pattern. I will need this for a developing of an idea 'pattern based filtration'.
I'm currently learning bash programming and am trying to create a program to maintain a list of people. Here is the code so far:
Code:
#!/bin/bash # Namelist clear
[code]....
As you can see, I attempted to build in a protective measure to prevent duplicate entries using "if grep -Fxq "$FN $LN" /home/andrea/namelist.txt", FN and LN being first name and last name as you can see in the first read operation. However, this fails to actually work. Demonstrations:
[URL]
It saves the details to the file rather than displaying the error message, or in other words, it doesnt check the file properly.
i am trying to get a script that i'm calling to have information from a sql populate into rows... but i'm not getting the data to output correctly into the rows. can someone please help?
my printer has a known CUPS bug; A4 is printed as letter size; i.e. printing only appears on the bottom half of the page. I downloaded a ppd file at [URL] but it improved nothing. Also installed the bug's patch (sorry I don't have the bug's number) and followed the instructions; zero results. Upgraded Ubuntu 9.04's CUPS-related repositories to 9.10 but no improvement. Every test page still comes out with just the top third sitting at the bottom.
I have a laptop that doesn't display correctly since installing F10 x86-64. Instead of using the i810 driver, I see the experimental intel driver. I am running on a Dell D630 laptop with the default intel integrated graphics.
Just to note: Running gnome. I tried KDE and I can actually get this to work and display in 1600x1200. I don't want, "well use kde then" to be the solution. Also, in gnome, if I go to the screen resolution option from the menu, the mirron screens is clicked. Even when I detect monitors and unselect the mirror screens and pick the correct resolution, when I click OK, the screen flickers, and I go back to the same screen with the original default values? Wierd.
I got the bright idea to install system-config-display (something like that), which installed fine. I then changed my default resolution to 800x640 just to try it (really want 1600x1200). Well, I decided to reboot. Not the laptop doesn't start, it stops right after loading anaconda, and just won't go any further.
So two questions:
1. What do I need to change to get the laptop to actually boot?
2. How to get the external monitor to display in 1600x1200.
I've added Warsow.i386 (0.5) to my Applications > Games menu as a shortcut, but whenever I try to run it, my screen goes black for a second and then returns to desktop. Running the same file from its folder in /home runs the game fine.Is this common problem with shortcuts or is it just me and the game?
my "places menu" references folders on a second partion, where I store all my personal files (ntfs, as I use it also from Windows). After boot those folders wouldn't show in Thunar. Some other programs, as Fontmatrix, wouldn't find databases stored there, what messes them up. Thunderbird has problems to recognize profiles etc.What is strange, the partition seems to be mounted at startup as I can see and select it from Thunar. Also, it appears on Desktop. After selecting the partition, closing and reopening Thunar everything works fine, places would show correctly and Fontmatrix database is ok
I use Wine on Kubuntu 10.10. Whenever some-application to open the Internet, wine browser is opened in loop untill I end process tree of wine server. Also when I use it to execute .exe program I have error e.g. I tried to run DriverGuide DriverScan:
Quote:
Component 'Codejock.DockingPane.v10.4.0.ocx' or one of its dependencies not correctly registered: a file is missing or invalid
I have installed Mozplugger and changed mozpluggerrc so it opens evince. However, it shows an embedded version in the tab that doesn't accept interactions and opens the version that can be interacted with in a new window. Does anyone know what may be causing this? I'm not very knowledgable with the specific commands in mozpluggerrc.
After the upgrade, I've noticed a problem I haven't had before - hibernating worked fine to the last. The problem is, although the system correctly hibernates, it makes no attempt to "wake" from hibernation when I power it up - it boots normally, and with fsck-ing like it was powered off without proper shutdown (understandably). I don't know why it happens, and I've skimmed the logs, but noticed nothing special. What could be the problem? What could I try? Which log should help someone find that out?
I'm running Kubuntu and have tested flash video sites with firefox, chromium and rekonq. I have installed all the available packages from Software Management but flash videos still don't display correctly. All get is a small rectangle of video on the bottom left hand side of the video box (which is otherwise grey).
My problem is that I cant "rewrite" older password to new. It looks like I do:
Changing password for user johny. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.
all looks OK but after set up new password I can log in using OLD and NEW password. It's very unsecure for me. So in fact I cant change password and it looks like centos create next password to one accout and one account have more then one password... how can I prevent it? pls help me couse its very unsecure in my case.user looks in file shadow /etc/shadow like this:
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
Code: #!/bin/bash trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c echo "Press ctrl+c during 5 sec loop" for ((i=0;i<5;i++)); do
[Code]...
How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!
I just upgraded my computer from Ubuntu 9.10 to 10.04 (beta2) restarted and the splash was screwed i thought meh i can live with it then went into my account switched to tty1(ctrl+alt+F1) and it was the same. got annoyed now asking had anyone else encountered/know how to fix this problem. pictures attached sorry for bad quality took on phone, but that is how it really looks.
I have the following problem: There are three NFS mounts in /etc/fstab, which are automatically mounted. The network connection runs over NetworkManager. Since NWM brings up the network asynchronously, NFS doesn't mount correctly on the first try, but is loaded soon enough since mount automatically retries until it works.
I can live with the fact that I have an error in my boot messages, since everything is up in time for the user. But, I need a (selfmade) upstart script which depends on the NFS mount being up. Even using "remote-filesystems" as the trigger doesn't help, because the trigger is apparently sent after the first failed try (I checked with cat /proc/mounts in my script, the nfs mounts are clearly not up.) Can I somehow force the remote mounts to wait until NWM is up, or make the NFS mount emit an event when the mounts really get mounted?
I recently dist-upgraded from Debian 5 to 6 (squeeze). Since then, the xclock I run from my window manager's start script isn't displaying correctly (it displays only a "0"). The thing is, if I run the same command in my start script in my terminal, it works just fine, as it has always done...
I use this rather "old" X applications because I like my programs simple/not buggy/fast, and it's resulting a rather annoying problem (being that apparently nobody else has it...). All other programs in my start script (gnome-terminal, emacs, xmodmap, etc) are working with no problems whatsoever.
My window manager: sawfish
Command to run xclock in my start script:
Code: xclock -digital -brief -geometry -0+0 Attached picture: Top: xclock initialized by start script Bottom: xclock initialized by terminal
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.
Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?
I recently had problems with my HP printer in Fedora 12, where as I never had a problem with it in any other distrubution.... For some reason, the HPLIP driver in the repo doesn't work correctly... I don't know why... but I kept getting errors with "error: Printer queue setup failed. Please restart CUPS and try again."
I tried every suggestion I found... which was installing extra dependencies, disabling firewall, disabling SELinux and a whole bunch of other stuff... but nothing worked... THEN finally I decided to use the HPLIP driver from the HP website... it was a .run file... and I executed it, and my printer has worked perfect eversince..... my question is.... has anybody successfully installed their hp printer from the hplip driver in the repo's..??? I don't know why it didn't work for me, and i've seen other fedora users complain of the same thing? maybe theres something wrong with the package? or its not pulling in a needed dependency? I don't know...