Skip to content
Advertisement

basename with spaces in a bash script?

I’m working on a bash script to create a new folder in /tmp/ using the name of a file, and then copy the file inside that folder. Behavior: When I type in mymove “/home/me/downloads/my new file.zip” it shows this: I have lots of quotes around everything, so I don’t understand why this is not working as expected. Also, I have

How do I create a native Debian package for static files?

I have a need to Debianize some static resources for a software project but am confused by the available information and could use some guidance in doing so. Here are the materials I’ve been reading: Rolling your own Debian packages Debian New Maintainer’s Guide Debian Library Packaging Guide Debian Mentors FAQ The Debian New Maintainer’s Guide seems the most apropos,

Windows Executable file structure

I know that generally the object file has code, data, heap and stack sections. But I want to know how this is arranged in windows executables and Linux executables. I searched on internet and found some structure. I understood .text is for code and .data is for global variables. I want to know here is the stack and heap in

Correct way to build “live” directory structure after maven build?

I have a multi module maven project which looks something like: main component_one subcomponent_bob subcomponent_mike subcomponent_joe component_one_aggregate component_two subcomponent_tim subcomponent_lary component_two_aggregate The aggregate projects create parent jars for each of the components containing all of their subcomponents. I have a pom in each directory, and it all deploys to a local repository. Everything works great! Except that I would like

Is rename() atomic?

I am not being able to check this via experiments and could not gather it from the man pages as well. Say I have two processes, one moving(rename) file1 from directory1 to directory2. Say the other process running concurrently copies the contents of directory1 and directory2 to another location. Is it possible that the copy happens in such a way

Bash/sh ‘if else’ statement

I want to understand the if else statement in sh scripting. So I wrote the below to find out whether JAVA_HOME is set in the environment or not. I wrote the below script This my output to env: But I get the below output: Answer You’re running into a stupid limitation of the way sh expands arguments. Line 3 of

Compiling C Program on OS X to Run on Linux

I have a pretty simple C program that does some cryptographic calculations using only standard library functions. I will be running the program on Ubuntu (10.04, 32 bit) and compiled it on OS X 10.6 using cc with the -m32 flag. When I tried to run it on Ubuntu I got the error message “cannot execute binary file.” When I

Running PHP script from command line as background process

I’m trying to run a PHP script continually in the background via the command line in Linux. I have tried the command php filename.php & but it seems like the script execution terminates very quickly, while it should keep running until the process is terminated. Any suggestions? Answer Are you sure the script doesn’t contain any errors? This is what

What does the brk() system call do?

According to Linux programmers manual: brk() and sbrk() change the location of the program break, which defines the end of the process’s data segment. What does the data segment mean over here? Is it just the data segment or data, BSS, and heap combined? According to wiki Data segment: Sometimes the data, BSS, and heap areas are collectively referred to

Advertisement