I'm working on a project in Python that I'm having trouble with. I've asked so many people but they seem to not be able to help me :/ I'm coding a little program that executes system commands. The idea is that one machine opens the server and the other one opens the client and connects to the IP / Port. From there they can execute system commands and obtain the output. Only problem is, with the output, I get something like this: [code] Enter a command: ls got: ls received: 2 Enter a command: [/code] I want the output of …

Member Avatar
Member Avatar
+0 forum 11

(Ubuntu Server) I have a folder full of files in pairs (one is a log, another is a DB backup) They are basically create/modified at the same time. I need a shell script that detects if the folder has more than 28 or 30 files (always will be a pair), it deletes the oldest two. What is the quickest way to do this?

Member Avatar
Member Avatar
+0 forum 3

Hello everyone. I realize that this may be an elementary question, but all of my searches for answers have not given me a satisfactory result. In my ubuntu server machine, I typed in [after examining my stty settings] `werase='^I'` as I was configuring the terminal to my likings. All was fine after I made that change and the command worked beautifully. After I logged out and logged back in, I could not use that shortcut anymore and I had to manually reprogram it to use it again. Could anyone suggest how I can fix this problem and make the setting …

Member Avatar
Member Avatar
+0 forum 3

Hello everyone, I am trying to merge large number of CSV files into one, using the following "awk" command, but if I increase the number of files more than 10,000, it then gives me "argument too long" error. Can someone suggest how I can manage to go beyond the limit? I am looking to merge some ~100,000 csv files together. awk '{print $0"\t"FILENAME}' *.csv > merged.csv Thanks.

Member Avatar
Member Avatar
+0 forum 5

hai am new to linux.i like to learn from this forum

Member Avatar
Member Avatar
+0 forum 3

Hi Friends, automated script for ssh trust setup?

Member Avatar
Member Avatar
+0 forum 1

Hello Everybody, I am trying to run a simple script to monitor a log file, where I need to send an alarm every time specific line is being written into this log file, currently my script is working fine, the problem is with the miltiple lines that is being written whenever I have a problem with my SW and many lines are logged into this log file which is causing many alarms to be sent, so I am seeking a way to trigger sending the alarm only one time but without existing this script, I need my script to keep …

Member Avatar
Member Avatar
+0 forum 4

garrett@mint-desktop /var/www/html/udemy/php-oop/gallery/backups $ tar --exclude-tag-all=backups -cf lesson20.tar ../* tar: Removing leading `../' from member names I have an empty file called backups in my backups directory to keep the tar file from trying to backup itself. Does anyone know why I'm getting this output? -> `tar: Removing leading ../' from member names` Note that there was a backtick between leading and ../ .

Member Avatar
Member Avatar
+0 forum 5

Hi, I have built a shell extension handler, using this as a template: https://code.msdn.microsoft.com/windowsapps/CppShellExtContextMenuHandl-410a709a In this instance, it registers with a ".ts" extension: hr = RegisterShellExtContextMenuHandler(L".ts", CLSID_LNtoALL, L"CppShellExtContextMenuHandler.LNtoALL"); The project compiles fine, and the registration works also. But on one PC, it fails to load (the context menu for .ts files is not updated), and on another (both using Win7 x64) it does. I tried 2 others handlers, with '.mkv' and '.mp4' extensions (using of course different CLSIDs), and the results are random. Some work on a given PC, and some not. I have no clue what prevents one handler …

Member Avatar
Member Avatar
+0 forum 1

Team, Presently i have some 20 files which i need to copy and store in the common directory. below is the example: script name: dir.sh cp /tmp/abc /home/abc/xyz cp /tmp/def /home/abc/xyz cp /tmp/hij /home/abc/xyz The above script is run, it copies the source files on the destination directory(xyz), wanted to make it more interesting. a)it should prompt me if the directory exist/else create it b)cp command should be taken as input file, so that incase i have more changes i can directly make changes to the file where all copy commands are stored c)maintain the copy files on the basis …

Member Avatar
Member Avatar
+0 forum 1

I want to write a shell script which finds main() in the given folder files and sub folder files

Member Avatar
Member Avatar
+0 forum 1

Hello, I have written the basic shell script "myscript.sh", which prints Hello World. I want to call this script using PL/SQL. Please let me know the procedure(steps) for the same. Thank you.

Member Avatar
Member Avatar
+0 forum 3

Hello everybody. How can i get "ls" from shell scripting? I tried this but it doesn't work, i saved it in a file: #!/bin/bash $ls I know the second line is not correct, so what should i type? Getting "ls" is just an example, i infact want to import this line to the shell: sqlite3 test.db to create a database.

Member Avatar
Member Avatar
+0 forum 2

Hi everybody. I'm using python to create sql database. I created a test.db file and then made a table on it with the name "fims" and inserted some data on it.... title text, year text and director text. And then set values for them. Now when i type "sqlite3 test.db" on the shell, and the "secelt * from films;" nothing apears. I did exactly what i saw on the tutorial video but the result was different. (Of course the tutorial is using windows, but i use Linux, so i know i should change some commands a little a bit, but …

Member Avatar
Member Avatar
+0 forum 12

Hi friends! I'm coding a program; i have a Tkinter window with a view button and i can add names with entry box and add button into a list that will be saved on a db file. Now i want the program to show the list names otomaticly when the program runs. The only problem is that if i want to run the program for the first time, there is no db file, so nothing can be load, so the program won't run and i get this error: Traceback (most recent call last): File "app3.py", line 156, in <module> refresh() …

Member Avatar
Member Avatar
+0 forum 2

Hey guys, I have this script that does count one year of files, 2014, but when it comes to this year, everything messes up. How could I count properly for each year in the same script ? In the attached screenshot it's obvious that I would only need 2014 - all of the months and from 2015 only January, but .... how ? Thanks in advance! ls -la | awk -v year="$(date "+%Y")" 'BEGIN { split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", month, " ") for (i=1; i<=12; i++){ mdigit[month[i]]=i } } !/^-/{next} $8 ~ …

Member Avatar
Member Avatar
+0 forum 4

I am working on a shell script that takes a single command line parameter, a file path (might be relative or absolute). The script should examine that file and print a single line consisting of the phrase: Windows ASCII if the files is an ASCII text file with CR/LF line terminators, or Something else if the file is binary or ASCII with “Unix” LF line terminators. currently I have tried the following code. #!/bin/sh file=$1 if grep -q "\r\n" $file;then echo Windows ASCII else echo Something else fi #!/bin/sh if test -f "$file" then echo Windows ASCII else echo Something …

Member Avatar
Member Avatar
+0 forum 2

How to read oracle control file's data using a shell script? Shell script is in Unix.

Member Avatar
Member Avatar
+0 forum 2

Write a shell script that will take a filepath and a string as command line arguments. The script should find lines which contain the given 'string' in the given file. It should create an output file in "/tmp" directory with the name in the pattern as below. "NN_15Nov2013_12Hrs_32Minutes_20Seconds.txt"

Member Avatar
Member Avatar
+0 forum 3

Hi, I need to monitor the ip addresses in a server. whenever there is a fluctuation, i need to do some clean up (like restart the server/ reboot the machine) I was able to get a sample cpp program & was able to enhance it to suit my needs. But i think it would be better if i am able to convert it into a shell script as it will give me more flexibility in parsing the output. any body has got any idea of the syntax to be used for netlink sockets in shell script, since I could not …

Member Avatar
+0 forum 0

I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb msgid "" hsdvchgsdvc msgstr "" dhshfjksdfhmd msgid "Vidya" msgstr "" sdjhcbnd dcndnv cfnkdndvrknvkf dfkvrnkdfnk snfvrkng msgid "Rome" msgstr "" wdbhkjbcfj #dmcdmf f,nvdf, fvnfnvk vfmf,mv vfn msgid "vid" msgstr "" dmcbdmbcvmfbvmkhsdk file 2: dfhkvgjbfrvkf msgid "Rome" msgstr "new bie" sdbsjbcdcbwoido fjcdcvnm msgid "vidya" msgstr "expert" dvnjfkdvhnkfvnknsbdjh msgid "vid" msgstr "newton" dfenfjdbrfjbvlfnvl dcnkncvkdfvknfv fcndkbvknfkv vfdnkvnfknbvkfn Later …

Member Avatar
Member Avatar
+0 forum 2

By examining the first, third and last (seventh) fields of the /etc/passwd file, determine the userid and login shell for your username, the user root, and the user nobody (yes, there is a system user with the username "nobody"). Create simple files in your home directory, called my.uid, my.shell, root.uid, root.shell, nobody.uid, and nobody.shell, which contain only the appropriate information on a single line. For example, if the user nobody's login shell were /bin/bash, the following command would easily create the appropriate file. `[student@station student]$ echo /bin/bash > nobody.shell` `[student@station student]$ cat nobody.shell` `/bin/bash` I don't know how to find …

Member Avatar
Member Avatar
+0 forum 1

I have no clue to why this isn't working but when I try creating a shell path variable in `/etc/bash.bashrc`. This is my variable `SCHOOL="/home/stephen/Steve's\ Stuff/School"` When I type `$SCHOOL` into the terminal I get `bash: cd: /home/stephen/Steve's\: No such file or directory`

Member Avatar
Member Avatar
+0 forum 1

Hello, I have one big XML file (600 MB - 850 MB) in format "**cells_yyyymmdd_hhmi.xml**" I would like to specify that everyday i will have new file with new date. So, *there should be general way to read it and cut it*. For exmaple, i have file of 7th January. Its, cells_20140107_154016 Goal is to split into small parts by shell script and do operation. It will be great if anyone can give input to check the filesize and if it is too big, make 4 parts instead of 3 parts. I did so far: head -1125000 cells_20140107_154016.xml > PART1.xml …

Member Avatar
Member Avatar
+0 forum 1

Hello, I have one tar.Z file. I have to run shell script **daily** as it is required to update the database. customer_yyyymmdd_hhmi.tar.Z sales_ yyyymmdd_hhmi.csv (5 MB - 20 MB) purchase_ yyyymmdd_hhmi.xml (650 MB - 950 MB) I have made small part of XML file. There are 4 parts. There is PHP Script which is working but i need to change each time file like PART1.xml, PART2.xml etc. **Things to do:** *1) Extract tar.Z file and Read CSV and XML file. 2) Read whole XML file automatically.* I hope i am clear. Thanks in advanced for your time and input.

Member Avatar
Member Avatar
+0 forum 2

hello, I created a awk program to work witha data file to output a table and subtotal the rows and total up the collums and average I got it to work but when i added a presentation header before my totals go away. working code so far ------ can be viewed at http://cwl-host.com/linux/wtest and when i added the presentation headder my totals went away http://cwl-host.com/linux/test im using awk -f wtest datafile.dat

Member Avatar
Member Avatar
+0 forum 1

Hi, Im working on a PHP script in which I have to run shell script, I have 2 option , 1. If im able to send php veriable value to shell 2. Or i can write shell directly in PHP I used shell_exec(dirname(__FILE__) ."/shl.sh"); for execute shell .... Now the problem is .. if i use #!/usr/bin/php in shell it only resolve code within <?php ?> and print shell statment directly on screen .. So I need a Urgent Help ... Please Help Me Out ...

Member Avatar
Member Avatar
+0 forum 1

I am trying to modify my shell sort algorithm to use Hibbard's increments rather than n/2. I know that Hibbard's increments are 2k - 1, but I can't figure out how to incorporate that into my algorithm. Any suggestions to help me move forward with this? I feel like I just can't figure this one out. Here's the working version of what I have now, which is NOT using Hibbard's increments: [CODE] public void shellSort(int[] array, int lowindex, int highindex, boolean reversed) { int n = highindex - lowindex; int increment; int offset; for (increment = n / 2; increment …

Member Avatar
Member Avatar
+0 forum 4

Hi all I want to login a machine remotely and doing some operation on the remote machine and then exit the remote machine by a unix shell script. I can login these two machines without passward. How can I do that? For example, my script is on machine1. that script remotely login to machine2 and do some operation on machine2. After doing that it exits machine2 and back to machine1. I had tried with this script from a machine1 #!/bin/bash clear ssh -Y sudipta@machine2.chem.udel.edu <<EOF echo 'welcome machine2' EOF However, it is giving '**Pseudo-terminal will not be allocated because stdin …

Member Avatar
Member Avatar
+0 forum 3

occasionally I run a backup of my phpbb forum files from the Shell command line: zip -r forum_backup ~/public_html/forum/* I'd like to add date elements to the file name, so that the zip file created is automatically formed as forum_backup_05182013.zip or something similar Thanks

Member Avatar
Member Avatar
+0 forum 1

The End.