Search Results

Search found 4938 results on 198 pages for 'unix timestamp'.

Page 14/198 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • unix at command pass variable to shell script?

    - by Andrew
    Hi, I'm trying to setup a simple timer that gets started from a Rails Application. This timer should wait out its duration and then start a shell script that will start up ./script/runner and complete the initial request. I need script/runner because I need access to ActiveRecord. Here's my test lines in Rails output = `at #{(Time.now + 60).strftime("%H:%M")} < #{Rails.root}/lib/parking_timer.sh STRING_VARIABLE` return render :text => output Then my parking_timer.sh looks like this #!/bin/sh ~/PATH_TO_APP/script/runner -e development ~/PATH_TO_APP/lib/ParkingTimer.rb $1 echo "All Done" Finally, ParkingTimer.rb reads the passed variable with ARGV.each do|a| puts "Argument: #{a}" end The problem is that the Unix command "at" doesn't seem to like variables and only wants to deal with filenames. I either get one of two errors depending on how I position "s If I put quotes around the right hand side like so ... "~/PATH_TO_APP/lib/parking_timer.sh STRING_VARIABLE" I get, -bash: ~/PATH_TO_APP/lib/parking_timer.sh STRING_VARIABLE: No such file or directory I I leave the quotes out, I get, at: garbled time This is all happening on a Mac OS 10.6 box running Rails 2.3 & Ruby 1.8.6 I've already messed around w/ BackgrounDrb, and decided its a total PITA. I need to be able to cancel the job at any time before it is due.

    Read the article

  • Decrypting EFS w/o altering timestamp - possible?

    - by grojo
    Hi, I'd like to decrypt some EFS-encrypted files, but I do not know how to do that without altering the timestamp. When encrypting/decrypting files, the modified-time is set to the current time. I'd like to preserve the original timestamp, as the files have not really changed. Is this possible? Solutions i dont think work copy to/from FAT (timestamp resolution differs) copy to from Samba share (same) programmatically copy original timestamp and reapply after decryption (possible, but need to handle decryption time which may vary)

    Read the article

  • On Linux/Unix, does .tar.gz versus .zip matter?

    - by rwallace
    Cross-platform programs are sometimes distributed as .tar.gz for the Unix version and .zip for the Windows version. This makes sense when the contents of each must be different. If, however, the contents are going to be the same, it would be simpler to just have one download. Windows prefers .zip because that's the format it can handle out of the box. Does it matter on Unix? That is, I tried today unzipping a file on Ubuntu Linux, and it worked fine; is there any problem with this on any current Unix-like operating system, or is it okay to just provide a .zip file across the board?

    Read the article

  • Is Cygwin the best Unix environment for Windows? [closed]

    - by nik
    Which Unix like environment do you prefer on Windows? I have found Cygwin to be very comfortable for a Windows platform (usually XP). I am wondering if there is a better alternative (not because I want to move away from Cygwin). What are the features of Cygwin that you like OR, What are features you find in alternatives that you miss in Cygwin? I am often miss binary compatibility of applications built on Cygwin. These cannot be run directly on another Windows platform. But, usually fetching a copy of cygwin1.dll suffices. A collection of other tools, many of which work directly on the Windows subsystem rather than emulating Unix, like Cygwin does: Have been referred PowerShell a lot of times for scripting on Windows Earlier, UnixUtils was suggested more often Microsoft Windows Services for Unix

    Read the article

  • On Linux/Unix, does .tar.gz versus .zip matter?

    - by rwallace
    Cross-platform programs are sometimes distributed as .tar.gz for the Unix version and .zip for the Windows version. This makes sense when the contents of each must be different. If, however, the contents are going to be the same, it would be simpler to just have one download. Windows prefers .zip because that's the format it can handle out of the box. Does it matter on Unix? That is, I tried today unzipping a file on Ubuntu Linux, and it worked fine; is there any problem with this on any current Unix-like operating system, or is it okay to just provide a .zip file across the board?

    Read the article

  • How to compile a C++ source code written for Linux/Unix on Windows Vista (code given)

    - by HTMZ
    I have a c++ source code that was written in linux/unix environment by some other author. It gives me errors when i compile it in windows vista environment. I am using Bloodshed Dev C++ v 4.9. please help. #include <iostream.h> #include <map> #include <vector> #include <string> #include <string.h> #include <strstream> #include <unistd.h> #include <stdlib.h> using namespace std; template <class T> class PrefixSpan { private: vector < vector <T> > transaction; vector < pair <T, unsigned int> > pattern; unsigned int minsup; unsigned int minpat; unsigned int maxpat; bool all; bool where; string delimiter; bool verbose; ostream *os; void report (vector <pair <unsigned int, int> > &projected) { if (minpat > pattern.size()) return; // print where & pattern if (where) { *os << "<pattern>" << endl; // what: if (all) { *os << "<freq>" << pattern[pattern.size()-1].second << "</freq>" << endl; *os << "<what>"; for (unsigned int i = 0; i < pattern.size(); i++) *os << (i ? " " : "") << pattern[i].first; } else { *os << "<what>"; for (unsigned int i = 0; i < pattern.size(); i++) *os << (i ? " " : "") << pattern[i].first << delimiter << pattern[i].second; } *os << "</what>" << endl; // where *os << "<where>"; for (unsigned int i = 0; i < projected.size(); i++) *os << (i ? " " : "") << projected[i].first; *os << "</where>" << endl; *os << "</pattern>" << endl; } else { // print found pattern only if (all) { *os << pattern[pattern.size()-1].second; for (unsigned int i = 0; i < pattern.size(); i++) *os << " " << pattern[i].first; } else { for (unsigned int i = 0; i < pattern.size(); i++) *os << (i ? " " : "") << pattern[i].first << delimiter << pattern[i].second; } *os << endl; } } void project (vector <pair <unsigned int, int> > &projected) { if (all) report(projected); map <T, vector <pair <unsigned int, int> > > counter; for (unsigned int i = 0; i < projected.size(); i++) { int pos = projected[i].second; unsigned int id = projected[i].first; unsigned int size = transaction[id].size(); map <T, int> tmp; for (unsigned int j = pos + 1; j < size; j++) { T item = transaction[id][j]; if (tmp.find (item) == tmp.end()) tmp[item] = j ; } for (map <T, int>::iterator k = tmp.begin(); k != tmp.end(); ++k) counter[k->first].push_back (make_pair <unsigned int, int> (id, k->second)); } for (map <T, vector <pair <unsigned int, int> > >::iterator l = counter.begin (); l != counter.end (); ) { if (l->second.size() < minsup) { map <T, vector <pair <unsigned int, int> > >::iterator tmp = l; tmp = l; ++tmp; counter.erase (l); l = tmp; } else { ++l; } } if (! all && counter.size () == 0) { report (projected); return; } for (map <T, vector <pair <unsigned int, int> > >::iterator l = counter.begin (); l != counter.end(); ++l) { if (pattern.size () < maxpat) { pattern.push_back (make_pair <T, unsigned int> (l->first, l->second.size())); project (l->second); pattern.erase (pattern.end()); } } } public: PrefixSpan (unsigned int _minsup = 1, unsigned int _minpat = 1, unsigned int _maxpat = 0xffffffff, bool _all = false, bool _where = false, string _delimiter = "/", bool _verbose = false): minsup(_minsup), minpat (_minpat), maxpat (_maxpat), all(_all), where(_where), delimiter (_delimiter), verbose (_verbose) {}; ~PrefixSpan () {}; istream& read (istream &is) { string line; vector <T> tmp; T item; while (getline (is, line)) { tmp.clear (); istrstream istrs ((char *)line.c_str()); while (istrs >> item) tmp.push_back (item); transaction.push_back (tmp); } return is; } ostream& run (ostream &_os) { os = &_os; if (verbose) *os << transaction.size() << endl; vector <pair <unsigned int, int> > root; for (unsigned int i = 0; i < transaction.size(); i++) root.push_back (make_pair (i, -1)); project (root); return *os; } void clear () { transaction.clear (); pattern.clear (); } }; int main (int argc, char **argv) { extern char *optarg; unsigned int minsup = 1; unsigned int minpat = 1; unsigned int maxpat = 0xffffffff; bool all = false; bool where = false; string delimiter = "/"; bool verbose = false; string type = "string"; int opt; while ((opt = getopt(argc, argv, "awvt:M:m:L:d:")) != -1) { switch(opt) { case 'a': all = true; break; case 'w': where = true; break; case 'v': verbose = true; break; case 'm': minsup = atoi (optarg); break; case 'M': minpat = atoi (optarg); break; case 'L': maxpat = atoi (optarg); break; case 't': type = string (optarg); break; case 'd': delimiter = string (optarg); break; default: cout << "Usage: " << argv[0] << " [-m minsup] [-M minpat] [-L maxpat] [-a] [-w] [-v] [-t type] [-d delimiter] < data .." << endl; return -1; } } if (type == "int") { PrefixSpan<unsigned int> prefixspan (minsup, minpat, maxpat, all, where, delimiter, verbose); prefixspan.read (cin); prefixspan.run (cout); }else if (type == "short") { PrefixSpan<unsigned short> prefixspan (minsup, minpat, maxpat, all, where, delimiter, verbose); prefixspan.read (cin); prefixspan.run (cout); } else if (type == "char") { PrefixSpan<unsigned char> prefixspan (minsup, minpat, maxpat, all, where, delimiter, verbose); prefixspan.read (cin); prefixspan.run (cout); } else if (type == "string") { PrefixSpan<string> prefixspan (minsup, minpat, maxpat, all, where, delimiter, verbose); prefixspan.read (cin); prefixspan.run (cout); } else { cerr << "Unknown Item Type: " << type << " : choose from [string|int|short|char]" << endl; return -1; } return 0; }

    Read the article

  • Regarding Shell Script

    - by arav
    I have the below line in the unix shell script. I want to exclude test.jar in WEB-INF/lib being added to the CLASSPATH. How can i do it? for file in WEB-INF/lib/*jar ; do CLASSPATH=$CLASSPATH:$PWD/$file done

    Read the article

  • How do I change the default for the "df" command in the Unix terminal from KILOBYTES TO MEGABYTES?

    - by user1656014
    I can't really show the code in Unix, but I can explain it very clearly. In the terminal, when you type "df", you get information on the disk free space all in KILOBYTE units. KILOBYTES is currently set as the default in Unix. My problem is trying to change the default from KILOBYTES to MEGABYTES. After changing of the default, I should be able to type in "df" and all the disk free space should come up in MEGABYTES.

    Read the article

  • Add the "SAMBA File Server" role to a server running SCO Unix?

    - by I.T. Support
    We're trying to get network access to a hard drive on a server running SCO Unix from Windows Servers. I beleive we need to add the role "SAMBA File Server" to the server so we can mount the drive as a network share that we can access from Windows. Is it possible to add the SAMBA role to a SCO Unix operating system? Are there any gotchas or concerns? Thanks

    Read the article

  • Creating a directory and parents directory in unix

    - by eveo
    I can't believe such a simple homework question is messing with me: Enter the Linux command to create both a parent directory called 'systems' and it's child directory called 'part3' at the same time. Assume that directory 'systems' will branch-off your home directory and that you are in your home directory to start. Use a relative pathname. You entered: mkdir -p ~/part3/systems/ Please try again. Hint: Use mkdir with the appropriate option Tried: mkdir -p ~/systems/part3/ mkdir -p ~systems/part3 mkdir -p ~/systems/part3 mkdir -p ~/systems/part3 mkdir ~/systems/part3/ mkdir ~systems/part3 mkdir ~/systems/part3 mkdir ~/systems/part3

    Read the article

  • Joining Multiple Fields Using Unix Join

    - by neversaint
    How can I do it? I have a file that looks like this foo 1 scaf 3 bar 2 scaf 3.3 File2 looks like this foo 1 scaf 4.5 foo 1 boo 2.3 bar 2 scaf 1.00 What I want to do is to fine lines that co-occur in file1 and file2 when field 1,2,3 are the same. Is there a way to do it?

    Read the article

  • Unix diff to only print relevant diff

    - by mkal
    I have these two files File:11 11 12345 File:22 123 456 Output of diff 11 22 2c2 < 456123 --- > 789 Output to be < 456123 > 789 I want it to not print 2c2 and "--" line. I looked at the man page but could not locate any help. Any ideas? The file has more than 1K lines

    Read the article

  • Rename multiple files in Unix

    - by john
    There are multiple files in a directory that begin with prefix fgh, for example: fghfilea fghfileb fghfilec I want to rename all of them to begin with prefix jkl. Is there a single command to do that instead of renaming each file individually?

    Read the article

  • Regarding UNIX Shell Script

    - by arav
    When there is no files inside the folder the below script goes inside the for loop. Not sure what i can modify so that it doesn't go inside the for loop. Also when there is no files inside the directory exit status should be success. Wrapper script checks the exit status of the below script FILESRAW ="/exp/test1/folder" . for fspec in "$FILESRAW"/* ; do echo "$fspec" if [[ -f ${fspec} ]] ; then ..... processing logic else ... processing logic fi done

    Read the article

  • Unix System Call in Objective-C

    - by Biranchi
    Hi all, Is it possible to make system call in Objective-C? I have the following code: if (!system("ls -l")) { NSLog(@"Successfully executed"); } else { NSLog(@"Error while executing the command"); } How to get the output? Thanks

    Read the article

  • Identifying and removing null characters in UNIX

    - by fahdshariff
    I have a text file containing unwanted null characters. When I try to view it in I see ^@ symbols, interleaved in normal text. How can I: a) Identify which lines in the file contains null characters? I have tried grepping for \0 and \x0, but this did not work. b) Remove the null characters? Running strings on the file cleaned it up, but I'm just wondering if this is the best way? Thanks

    Read the article

  • How can UNIX access control create compromise problems ?

    - by Berkay
    My system administrators advice me to be careful when setting access control to files and directories. He gave me an example and i got confused, here it is: a file with protection mode 644 (octal) contained in a directory with protection mode 730. so it means: File:101 100 100 (owner, group,other: r-x r-- r--) Directory:111 011 000 (owner, group,other: rwx -wx ---) How can file be compromised in this case ?

    Read the article

  • Unix RPC programming

    - by Abhi
    Heyy all, I needed some help with ONC RPC programming. My task is to create two-tier client-server architecture wherein one main server (something like a directory) keeps a track of level-two servers and acts as a lookup; the level-two servers exposing some trivial functions, and finally, the clients for level-two servers. The clients ask the directory where a server is located, and then communicate with it. Using RPCGEN, we can create a pair of client-server code; however, the clients in this case need to have stubs for the directory as well as the level-two functions. Being a newbie to RPC, I'm having trouble conceptualizing the way I should code this. How can I call a function from a different server if a client is generated using a different IDL ? Any pointers would be appreciated :) Regards, Abhi

    Read the article

  • Regarding Unix shell script

    - by arav
    I want to retrieve the file from the INFILE directory which are begining with the file names prefix "BBSCGG_" or "BCT_" or "ACL_" or "ASC" and do the processing inside the for loop INFILE=/ext/test/fil1/ for infile name in file prefix ... if [[ -f ${fspec} ]] ; then processing logic else processing logic done how can i do it

    Read the article

  • UNIX script to convert queries

    - by Harish
    I need a UNIX shell script to convert my queries from Java compatible to Oracle compatible format. ie. I have all the java compatible queries: java: SELECT a, b, c, d, e, f,g "+// "from test where year(timestamp)=year(today) and month(timestamp)=month(today) " +// "and day(timestamp)=2 and h='" + "W" + "'" Oracle SELECT a, b, c,d,e,f,g from test where year(timestamp)=year(today) and month(timestamp)=month(today) and day(timestamp)=2 and h='W' Is it possible using sed or awk?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >