Programming :: Writing A Shell Script That Logs Some Actions?

Mar 26, 2010

I need help creating a script that makes a log file in wich to save information about every user that uses the ftp command (information like username and date) and the server to wich he is trying to connect.

View 2 Replies


ADVERTISEMENT

Programming :: Writing A Shell Script For Running A Package From IRAF?

Jan 10, 2011

I want to run gallist pkge from iraf for several times.. The step for running that

is:>xgterm &
>ecl &
ecl>noao
noao>artdata

artdata>epar gallist (I set some parameter) then by writing gallist iraf terminal the pkge is run:

artdata>gallist

I want this pkge is run for 1000 time and all output result are collected in only one file.

View 1 Replies View Related

Programming :: Writing Shell Snip To Import CSV Data Into Bash Array

Jan 5, 2011

I have been trying to write a simple snip of bash shell code to import from 1 to 100 records into a Bash array.

I have a CSV file that is structured like:
record1,item1,item2,item3,item4
record2,item1,item2,item3,item4
record3,item1,item2,item3,item4
record4,item1,item2,item3,item4

And would like to get this data into corresponding arrays as such:
$record1[item1-4]
$record2[item1-4]
$record3[item1-4]
$record4[item1-4]

View 9 Replies View Related

Programming :: Writing Unix Shell Script To Pass File Name/path/creation Date?

Oct 7, 2009

I'm new to UNIX scripting; I�m stuck with the following I have an Oracle SQL script that takes three parameters

1- File Name
2- File Path
3- File creation date

Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need is a UNIX script that can do the following

Loop through Directory "/home/applmgr/snktmp"
Picks only files
Pass the file name to parameter &1

[code]....

Is the above possible? I already knows how to call the Oracle Script from UNIX Im only stuck on writing the UNIX part where it List the files attribute(name,path,date) and store them to parameters ,Looping until the last file in the directory If the above is not possible,then how can I create the below from the command line

Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate

View 4 Replies View Related

General :: Auto Start Shell Script On Other Actions?

Aug 6, 2011

I have a particular script xxxx in folder yyyy. How can i start/execute xxxx whenever i open or cd into yyyy.

View 3 Replies View Related

General :: Writing A Custom Xsession In Ubuntu That Logs Out On Process End

Aug 30, 2010

Im trying to create a custom xsession on Ubuntu 10.04 that will launch nxclient and logout automatically when it closes.

This is what I have so far

Code:

How would I go about altering this script to logout when nxclient closes? To make this more complicated, nxclient spawns a separate process (nxssh) when it logs in and closes itself.

Is it possible for a script to listen for a child process to close and then execute some commands (in this case a logout)?

View 1 Replies View Related

Software :: Redirecting Apache/Tomcat Logs To Rsyslog Without Writing To Disk?

May 27, 2011

For internal security reasons I need to prevent ourmcat logs from writing to the webserver local disk. We set up a separate logging server with rsyslog and need to pipe the log data to it.I am trying to work out how to configure tomcat to send all log data to the logging server via the rsyslog client (running locally) via a named pipe. We are on CentOS 5.6, Tomcat 6 and rsyslog 5.8.1. I need to know: 1) do we use the default logging library or log4j2) where is this configured in the tomcat config3) is there any code that would need to be written to achieve this

View 1 Replies View Related

General :: Writing To The STDIN Of A Shell?

Jul 28, 2010

I am trying to write input to a shell and get the shell to parse the input that I am writing to it as if a user was typing in commands.

Thus far I have tried echoing some text into the shell's FD for STDIN in /proc/<pid>/fd Whilst this displays the text that I echo, the shell that I am writing to never tries to execute the command that I pass to STDIN. What is the difference between a shell taking STDIN from the user and data written to STDIN by another process e.g. echo ? It appears I am missing something fundamental.

View 5 Replies View Related

Programming :: Trace The Actions That Are Performed By .cshrc File?

May 11, 2011

I need to trace the actions that are performed by my .cshrc file. Is there a command i can use to get a printout of this?

View 3 Replies View Related

Ubuntu :: Writing Log Files With A Shell Script?

Feb 6, 2011

I want to perform an action with a shell script and then log the event in a file in /var/log. However, I keep getting permission denied error messages.

View 5 Replies View Related

General :: Writing A Bash Shell Script For Website Backup

Aug 10, 2010

I am about to write my first shell script for backing up my server.

These are the steps I have identified so far.

Copy files to be backed up to /srv/backup/ run mysqldump and copy the file to srv/backup/databases run duplicity to backup /srv/backup/* to another folder on my machine

I am writing a bash shell scrip that will be run everyday, and will carry out the three tasks mentioned above.

Note: point 3 (backing up to a local folder) is only a temporary measure - to allow me to understand what I'm doing, since all the tools I am using, are new to me. Once I can backup and restore correctly, I will use duplicity to compress and encrypt the files and upload them offsite.

If my understanding of duplicity is correct (according to the documentation here), the first time I run the script, a FULL backup will be done. Every subsequent backup will then be incremental. I will then force a FULL back on say a weekend.

First things first though - I have a few questions:

I would like to use backup rotation for the 'scheme' described above - I would like some recommendations on what kind/type of rotation to use. Once I have implemented the backup rotation, how can I restore from a particular day back in time (assuming the backup exists of course). ?

I am running Ubuntu 10.0.4

View 1 Replies View Related

General :: Shell Script That Logs Into Another Machine And Executes Some Commands?

Jan 5, 2011

I am trying to write a script that connects to a server and executes some commands on there. Something like this:

#!/bin/sh
telnet remote_machine
cd /home/some_directory
cat a_file_in_current_directory

Unfortunately after login/password I guess the script doesn't jump past the telnet command, until I exit. What do I need to do to make the script start executing commands in the remote shell?

View 1 Replies View Related

General :: Convert Shell Logs - Incl. Escape Characters - To HTML?

Mar 6, 2010

Is there tool or a regexp that can convert shell escape characters to HTML code?

As an example, here is a logfile from GNU screen:

Which I would like to convert to something like this:

And send as HTML e-mail to an e-mail address, to archive my work.

Here is a related question, which shows how to convert it to regular text, but it would be nice to convert to HTML and not just throw the escape characters away.

View 1 Replies View Related

General :: Shell Script Or Command To Remove PDF File From Large Logs?

Jul 13, 2011

I need to remove a large binary file(PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the logs smaller and manageable

I need to take out the texts (or binary file) between the strings

<my:PDF> and </my:PDF>
<applicationForm> and </applicationForm>
<image> and </image>
<extractedSignature> and </extractedSignature>

I am not sure whether sed utility can do this, these are large files and need to be pruned .I am not seeking logrotation advice just a script or command that can strip these large logs of texts between the characters above . I am not sure how to do this.These files are rather large.I am not sure how to achieve this with sed , tail, head , tr or any other facility .

View 2 Replies View Related

Ubuntu :: Writing A Single Shell Script To Change Preview Settings And A Launcher's Icon

Mar 22, 2010

I want to write a single shell script that allows me to, once executed from a panel launcher, change the image preview setting between "local files only" and never. Right now i have two tiny scripts, one for local files only and another one for never, that is:

[Code]...

and the other says string "local_only". But that means i need to have two launchers, because i don't know how to write the condition <<when set to never, change it to local only. And is it possible to make a script that also changes the launcher's icon when the preview config is set to one or the other value? That way i'd know what it is set to just by looking at it. It would act as a diagnostic and therapeutic tool XD

View 9 Replies View Related

Ubuntu :: Nautilus Actions - This XML File Is Not A Valid Nautilus-actions Config File

Feb 18, 2010

I've been trying out Nautilus-actions (Gnome 2.28.4), but have been unable to import most config files from [url].

When I attempt to import an action, it complains:

Quote:

Can't parse file 'convert_flv_to_avi.schemas' as GConf schema description file!

This XML file is not a valid Nautilus-actions config file (missing keys: )

So far, the only one that has worked for me is "Move to custom folder" [url].

View 2 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

Programming :: Writing A TCP Server ?

May 2, 2011

I am going to write a TCP server program using c. Can anyone give me some advices on whats and what not to do specially when using select?

There would be a lot of data to be transferred both on the server and back to the client. I already have a simple server here but the server uses a lot of resources. Maybe 3 to 4 connections and the server's load would rise to unacceptable levels.

Which do you think is better to use fork or select?

View 4 Replies View Related

Programming :: Writing A Page In PHP?

Apr 21, 2010

I want to write some PHP for a website that'll have the data that the script will generate written inside a table with thin black line around it, much like LQ itself. My problem is: how do I draw the box that the text will be inside of, since the amount of text will vary - if I have a GIF with a picture of a box, that'll be of a fixed length, and my script can then only generate that much text, for it to look nice. Or do I need to fiddle with the GD library to get done what I want?

View 4 Replies View Related

Programming :: How To Implement Whole New Writing System

Aug 11, 2010

So basically, there is a really cool writing system I have been working on. It could be viewed (for simplification purposes) like an encryption method for the Latin script.

Facts about the writing system:
It has a little over 300 symbols.
It is syllable-driven.
It is highly compositional (eg. "c", "ca", "cae", "ca " and "ci." all map to different symbols - and NOT by overlaying elements)
Symbols have medium graphical complexity (comparable to Korean Hangul, or Japanese Hiragana)
Has a rather complex set of diacritics (~10, some of which can go on any symbol)
Has no ligatures

How transliteration occurs:
Sequences of Latin symbols map to certain symbols. Example below:[G][rou][p ][hu][g.]Characters sequences between "[" and "]" map to a single symbol (so it would take only 5 symbols to write "Group hug.").

How I want it to work:
I would like to have a daemon that: Intercepts all text displayed on the screen.
Converts it to my writing system (changes letter sequences with individual Unicode codes)
Leaves unsupported symbols unchanged.
Displays all the text on the screen using my font and characters intertwined with the fonts and characters left unchanged.

For example, if you take the following line of C++ code:for (i = 1; i <= n; i++)
I would like it displayed like this:[fo][r ]([i ]= [1]; [i ]<= [n]; [i]++)
Bold-symbols should be in my Unicode font with special symbols defined for this writing system, and the rest should be in its original font and encoding. Also, I would like this encoding to hold for display-purposes only. The data in the memory should remain unaffected. This also means real-time adjustments: if I open a text editor (say, from the OpenOffice Suite) and I start typing, I would like to see what I type encoded with my writing system, even though the document actually contains Latin letters. This also means that the symbol immediately before the cursor may change as you type.

View 3 Replies View Related

Programming :: Writing A Daemon That Can Update Itself?

Apr 27, 2011

I have written a daemon server. I would like to add the ability for the daemon to update itself. That is, it should be able to download the latest version of the code (when it receives a signal from a client) and then restart itself. I am stuck on getting the daemon to restart itself. The problem is killing the old daemon without killing the process that is starting the new daemon. In my latest attempt, the daemon that is updating itself runs a program in a subshell (using system) that starts a restarter daemon that runs the original daemon (again using system) with the restart command option. With the restart option, the new version of the daemon sends a terminate signal to the old version. Obviously, when I run the original daemon manually with the restart option, it restarts reliably. I figured that issuing the same restart command from a daemon would adequately isolate the process doing the restarting from the program being restarted. Using ps, I can see that the daemon does actually restart. However, the client locks. In fact, a few times, the OS locked and I had to reset.

View 7 Replies View Related

Programming :: Writing A Mkdir -p C Program

Apr 9, 2011

How to write a mkdir with -p option. I am struggling for creating subfolders. the chdir() is not working and thus subdirectories can't be created.

Code:

View 1 Replies View Related

Programming :: Writing File In Perl/cgi?

Apr 10, 2010

I'm not able to write to a file using my perl cgi script which is as fallows:

Code:
#!/usr/bin/perl -w
use strict;
print "Content-type: text/html

[Code]....

View 4 Replies View Related

Programming :: Writing Files Using O_DIRECT In C?

Feb 28, 2010

I am trying to write .pgm images using the O_DIRECT flag in open().I have a char* buffer which has the image data. I know that I have to align the buffers and have done that using posix_memalign() yet only a part of the image gets written.Has someone used O_DIRECT for writing files successfully?

View 1 Replies View Related

Programming :: Writing Console Application?

Jul 7, 2010

I'm trying to write a simple, console based application in linux, in c++. I know how to start in Eclipse and I have some experience in c++ from Windoze. I would like to ask, if there is some tutorial available on writing console apps. I mean, I know from using linux that there are two conventions on using parameters in command line (-v and --version for example).

View 2 Replies View Related

Programming :: Writing Routers In C Or Python

Mar 19, 2011

My platform is linux Centos 5. I have read that to learn programming is to read well-written code and take some project to work with. I am always fascinated by routers and firewalls. Like pfsense and vyatta. May be my searching skills are worst but i am not able to find any good tutorials. Ofcourse i dont expect anyone to write a complete router on their blog but wasnt even close to it.

View 1 Replies View Related

Programming :: Java AT Command Writing Errors?

Nov 11, 2010

I am running a java application on centos. For now I have a gsm modem connected via the the usb cable. Below is the message I get when I type the command dmesg | grep tty

serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
usb 2-2: pl2303 converter now attached to ttyUSB0

[code]....

View 9 Replies View Related

Programming :: [C++] Writing Double Value To A Text File?

Jun 3, 2011

Code:
int main ()
{

[code]...

View 9 Replies View Related

Programming :: An Assignment: Writing A Bash Script

Oct 2, 2010

I have assignment to write bash script and I have to submit it after tommorow . I do not have experience to finish it by myself.I am really need help if any one can contact me. on my email I will be thanks him/ her.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved