Title pretty much nailed it, Im copying files to a flash drive and then doing some things to those files. Well I have noticed that after running the dd command the flash drive is still flashing and not all the files are on the device. Does anyone know how to maybe run a simple loop (in script) to wait on
Tag: scripting
How can I run a function from a script in command line?
I have a script that has some functions. Can I run one of the function directly from command line? Something like this? Answer If the script only defines the functions and does nothing else, you can first execute the script within the context of the current shell using the source or . command and then simply call the function. See
What are the alternative(s) to applescript in Linux? How are they different?
I’m preparing to switch to Linux. I want to learn more about what Linux users do to solve problems that OSX users solve with Applescript. More specifically: What are they called? How are they different? Answer I am assuming you’re using applescript for basic system automation. There are a wide variety of languages available, but none as closely/uniformly integrated with
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
Combining two files in different folders in Linux
I have two set of folders that have files with the same filenames and structure. The folder structure is something like this: So what I need to do is to combine (append) all the files with the same name in these folders (file1.txt with file1.txt etc.) into another file inside the outputfolder. After getting these combined files I also need
Simplest way to script slowly sending data through a socket connection
I need to periodically connect to a server from a Linux client and send some commands, so I wrote this script: The problem is that I need to wait between commands. This script sends the commands and disconnects too quickly, which the server detects, and drops the commands. It works if I open the connection from the command line and
extracting unique values between 2 sets/files
Working in linux/shell env, how can I accomplish the following: text file 1 contains: text file 2 contains: I need to extract the entries in file 2 which are not in file 1. So ‘6’ and ‘7’ in this example. How do I do this from the command line? many thanks! Answer Explanation of how the code works: If we’re
PostgreSQL without password prompt : .pgpass ignored
I’m trying to enable root (Ubuntu 8.04) to use psql command without password prompt (for scripting purpose). Everything worked fine with PostgreSQL 8.3, but I migrate to PostgreSQL 8.4 and the login without password doesn’t work anymore. I’ve a correct .pgpass file (the same used for 8.3), the right of /root/.pgpass are 0600 but calling psql keep asking for a
Retrieve plain text script from compiled bash script
Some time ago, i wrote some bash scripts for my school. I thought it would be very clever to ‘protect’ them, so i compiled them with shc into a binary file. Some weeks later, i lost the uncompiled scripts and now i have only my binarys left. Is there a way to retrieve the scripts back from the shc generated
Get the name of the directory where a script is executed
I have some script, that uses files in directories around it. It uses command. It should work from any directory where I run this script, but when I run a symbolic link that points to that script I get the path of symbolic link. So I get the output of dirname rather than the path of the script itself. Any