Software :: Use Basic Math Functions From The Command Line Like Sqrt?
Sep 14, 2010
I have a user that wants to use basic math functions from the command line like sqrt and such. Apparently it was installed on the previous server we were using, but not on this new Debian server by default.
Why are basic math problems returning 0? I know that Integers can only hold whole numbers, and it had the exact same problem when I used floats. I am using GCC 4.4.4.
I wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted:
1. I was wondering if there were certain terms for the various areas on the desktop. I'm using the classic layout in Ubuntu (I read many say they liked Gnome better than Unity, and classic is closer to Gnome). Are there terms to describe the following areas in Ubuntu?:A. The first area has Applications, Places, and System menus. This seems most comparable to the Windows start menu.B. The panel at the bottom of the desktop shows which applications or files are running. It looks like the task bar.C. There's an area of one panel that allows you to shutdown, restart, etc. It also has networking options, sound options, time settings, and other things. This makes me think of the system tray. I think this area may also have a notification area, but I haven't noticed any notifications.
2. Are there any options within Banshee to remove all but the most basic functions? Media Player in Windows had an option to go into some compact or skin mode where it took up very little space. I noticed some sort of Banshee player within the sound controls in the (system tray). Something similar to this would be ideal. I'd like to be able to just select a bunch of songs in a folder and play them all in this condensed version of the audio player.3. This has to do with the auto hide feature of the panels when they are located on the left and right side of the desktop. It seems as though the panels will only reappear when my cursor hits the very top of the screen on the corresponding side. So if a panel was set to auto hide on the left side of the desktop, it would only reappear when the cursor was in the top-left-most part of the screen. Is there a way to make it appear when my cursor touches any part of the left edge?4. I noticed that I was able to access some files and folders on my Windows partition while in Ubuntu.
A. Can modifying files on the Windows partition have some unwanted consequences?B. If I made another Linux-based partition, would my current Ubuntu partition be able to access files in the new partition in the same way? Would this require root privileges for every action?5. I've read that modifying the Windows partition from Ubuntu with something like Gparted could have negative effects on Windows' ability to boot properly. Are there similar dangers when modifying the Ubuntu partitions from Windows?My HDD is currently partitioned like: Win7 400GB, Ubuntu 100GB.I'm thinking about setting it up like: Win7 350GB, Ubuntu 100GB, unallocated 50GB.
If modifying the Ubuntu partitions from Windows can have negative effects, how should I go about setting this up?6. Is there a way to set the size the icons on the desktop without having to resize each one individually.7. How difficult is it to set up a customized theme? I haven't found a theme for the controls that I've liked yet. I've seen a couple that were pretty decent, but usually one thing would ruin the theme for me. This made me wonder about making my own.8. I believe the media player in use right now is Totem. Like with Banshee, is there a way to have most of the controls of this application hidden or made less noticeable? I tend to favor a minimalist approach when customizing things, so being able to reduce the number of things showing or being able to hide them when I want is always a plus. Maybe someone could suggest an alternate media player that works well to accomplish this. If another player could be paused when the video is clicked, that'd be a small plus.
9. When setting the folder permissions (read, write, execute), do these overwrite the individual file permissions within the folder? I believe I read that this applies to other folders within the folder. Or do the folder and file permissions not interact with one-another?10. My understanding of folder permissions is that none will work without the execute permission being enabled. Why is this? I read of the followingconfigurations(r:read, w:write, x:execute): r-x for read only, rwx for read and write, --- to deny access. The tutorial I read this from advised against otherconfigurations. What would happen if you allowed read and write permissions but disabled execute permissions for folders? What happens if only execute permissions are granted?11. I have the display set to dim when idle. What does it mean to be "idle"? The amount of time it takes for the screen to dim seems vary randomly.
12. This chunk of questions relates to Linux and its uses with various companies.A. Why do companies that use Linux machines heavily use these Linux machines? Is it just an open source, money-saving matter?B. For a person whose responsibilities are to maintain and run things on these machines, what might his or her responsibilities include?C. What sort of skills should this person have? What other technologies are often used in conjunction with Linux machines to accomplish some of the companies' goals?D. I'd imagine that with servers or whatever other things are running on these machines, the companies wouldn't want excess software or system files to be taking up resources. This leads me to think that thesemachines would have to be handled without GUIs and such. Would one be able to simulate the limitations of these machines in Ubuntu? Is it as simple as limiting one's self to the terminal to do everything? Are there things Linux can do on its own that Ubuntu cannot do?
By pressing 'properties' on a folder it freezes and I have to do killall nautilus && nautilus to get it working again. I have found no fix when googling (saying some packages that isn't installed is the problem).
It just takes a really long time to load based on the CPU usage.
i've gotten my fedora 12 to the point where i can run python3 scripts from command line and can call up python 2.6.2 idle with the command 'idle' from command line. what command will call up python3 (3.1.2 to be exact) idle?
I'm trying to create a super simple shell script, but I cant get a return line. The shell script looks like this (only the part that matters) Code: yes '' | ssh-keygen The idea being it will put in a blank char. Then enter until the program finishes. The problem is, it only does the first time, the next 2 times I have to hit enter, it requires me to input it manually (which is exactly what I'm trying to avoid).
The full script (if you care): Code: #!/bin/sh # Created by Omega # First, program creates RSA key, named id_rsa and id_rsa.pub # Second, program send the public code to requsted server. echo 'Removing old id_rsa key (if applicable)' rm -rf ~/.ssh/id_rsa.pub rm -rf ~/.ssh/id_rsa echo "Creating RSA key" yes '' | ssh-keygen
# Checking if ssh-kkeygen created requested file if [ -e ~/.ssh/id_rsa.pub ] then echo 'Done' echo 'Username and Server in: me@server format' read var1 echo 'Port Number? If standard put 22' read var2 ssh-copy-id -i ~/.ssh/id_rsa.pub "-p $var2 $var" else echo '' echo 'ERROR, ssh-keygen did not execute correctly' echo 'Retrying...' echo '' echo 'Please leave all options default (just press enter)' ssh-keygen if [ -e ~/.ssh/id_rsa.pub ] then echo 'Done' echo 'Username and Server in: me@server format' read var1 echo 'Port Number? If standard put 22' read var2 ssh-copy-id -i ~/.ssh/id_rsa.pub "-p $var2 $var1" else echo 'ERROR, ssh-keygen did not execute correctly' echo 'Quitting' exit fi fi # End
None of my daemon scripts work now, and the startup process displayed errors. Should I reinstall the OS and start from scratch, or is there a way to recover these files? Is there a way to rebuild the files I deleted?
I've configured my debian lenny to load first the command line, then if i want I load the X server, but doing this to that way I don't have the suspend/hibernate functions from the gnome menu, so, my question is:
what is the command to suspend / hibernate my system at any moment I decide?
I was thinking to install a very basic SSH gate, secured over SSL, like this [URL] using PHP. However I would like to have it very basic and simple to install. (not database SQL, nor complicated things, ...) so that I get a prompt page with login and password to access the SSH-internet, and then can SSH the linux box over SSL and regular port 80 like they do. passwd would be in a txt file or whatever. You use index.htm and no one can scroll the tree of the directory. Would have someone already embedded php code for that?
I wrote the following script to organize my music files and to learn a bit more about bash.
My problem is, now that I'm almost over the first version, that functions which are surely spelled correctly and were recognized in the past, are giving me the "command not found" error!
Code: #!/bin/bash # This is a script for moving tagged files into organized directory trees. ##### Variables filenum=0
$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?
I know my way around MS Windows much better, but I just don't feel right trying to program something for Android on a Microsoft operating system. I am interested in Android programming so I followed the instructions on [URL] to install the environment on my computer...
I just installed the JDK, SDK, Eclipse successfully (or I assume):
* When I get to Step 4 where I'm supposed to run 'android' it will not run. I get the error message "android: command not found" (I am definitely in the right directory).
** When I double-click it in nautilus, it opens up in gedit. I can set the permissions in nautilus (through the properties - Allow executing file as a program) and get it to work,
which does not work on the invisible directories (why?). When I used ".*" as wildcard it changed all (visible) files including the parent directory (the one I was currently working in which is the "dot") . I can change the invisible directories owner and group using dophin but how is it done from the command line?
how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here:
Code:
#! /bin/bash # #TODO write this for gnome and xterm
[code]....
This same error occurs if the gnome-terminal line is changed to
Code:
gnome-terminal -e mcTerm
Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.
I am trying to learn how to pass more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
Code: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ${0##*/} [-x] [-g] code....
However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.
This same error occurs if the gnome-terminal line is changed to
Code: gnome-terminal -e mcTerm
Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.
Using netbook asus 1005ha with lucid beta 1 with most of updates on learning to use the CLI and headaches cd command does not seem to reconise directories here is a sample
Code:
yeh i know read the f#####g manual i am but any help would be greatly accepted tried sudo with same commands same problem did have a problem on my debian system that was to do with paths this is not the same on a different footnote anyone thinking of upgrading to lucid sit tight on 9.10 there are still to many issues that need ironing out for a system that is your main system.
I just built a VMWare VM from the Fedora 13 DVD - 64 bit. It now wants to do 385 updates so I let it download all of the rpms. As it starts to do the install I get a Transaction Error to the effect
Quote:
Test Transaction Errors: installing package kernel-2.6.34.6-47.fc13.x86_64 needs 8MB on the /boot filesystem
System monitor shows that I have 19.7 MiB available on /boot - so what is going on?
I've started programming in c recently . following are the details about scene:
* vim is editor and program is compiled in gcc whenever a program involving math function appears it gives error i.though math.h is included in header file compiler complains about it it gives error of unrecognized function that math function like sqrt, etc question is how to connect math.h to a program.