131 Topics

Member Avatar for
Member Avatar for Meena Yegappan

Hi I am trying to run a python script which has this code snippet: process = subprocess.Popen('./start_ws.pl') process.wait() os.system('make') The perl script started changes environmental variables and enters into new subshell. After entering into new subshell, the commands below script os.system('make') goes unnoticed.They get executed only if i exit from …

Member Avatar for slate
0
490
Member Avatar for chriswelborn

I'm no pro when it comes to BASH, but I have been known to shell-script my way out of a problem here and there. One of the useful things you can do is a for-loop, whether it be used on file names, script arguments, or just a string of words. …

Member Avatar for chriswelborn
0
298
Member Avatar for chriswelborn

I'm no pro when it comes to BASH, but I have been known to shell-script my way out of a problem here and there. One of the useful things you can do is a for-loop, whether it be used on file names, script arguments, or just a string of words. …

Member Avatar for chriswelborn
0
378
Member Avatar for chriswelborn

This is another useful script I came across. It prints a color-code chart in your terminal. It can help you find the color-code you are looking for, or view the current color-scheme you are using (people use it on reddit/r/unixporn to show off their system's theme, I use it to …

0
371
Member Avatar for yue.sun.35

Hi guys I try to run this shell in java but it never works. Process p = Runtime.getRuntime().exec(" cat *.java|sed '/import/d'|sed'/package/d'>>b.java "); when I change the cmd to something like "ls" or "open foo.java" the code will works. Any idea why?

Member Avatar for jwenting
0
94
Member Avatar for old_apache

i have 2 files, one file created on Windows and another was made on Ubuntu, i want to use this command: comm -12 file1 file2 how do i do that?

Member Avatar for old_apache
0
183
Member Avatar for old_apache
Member Avatar for pooh1234qwerty

i am a beginner. i need online tutorial for shell scripting. there are many on the web.. which one to choose??

Member Avatar for DoRight
0
230
Member Avatar for OsaMasw

hello guys, unfortunly my website got hacked few hours ago, and after investigations I found the was a c99.php file on my server so i deleted it and stopped any upload proccess and change back my chmod to default I want to ask how to prevent php files from being …

Member Avatar for naphets
0
2K
Member Avatar for asa88

I am having trouble having redirection working with the ability to hit enter and remain in the same shell. My problem is if user types: ./a.out < foo.txt (where foo.txt contains a command like date) I want to execute that command and exit the shell.However,if the user compiles the code …

Member Avatar for deceptikon
0
351
Member Avatar for gtam

Hello I'm writing a script to get content of web pages on different machines and compare them using their md5 hash hear is my code #!/bin/bash # Cluster 1 CLUSTER1_SERVERS="srv01:7051 srv02:7052 srv03:7053 srv04:7054" CLUSTER1_APPLIS="test/version.html test2/version.html test3/version.jsp test4/version.html test5/version.jsp" # Cluster 2 CLUSTER2_SERVERS="srv01:7055 srv02:7056 srv03:7057 srv04:7058" CLUSTER2_APPLIS="test/version.html test2/version.html test3/version.jsp test4/version.html" # …

Member Avatar for Watael
0
227
Member Avatar for microlifecc

I have been trying to install Fedora on my laptop which came pre-installed with Windows 8.I need fedora coz i have a course on Unix shell programming dis semester.But i haven't succeeded coz the bios is kind of different from the earlier ones.can u guys suggest me some way i'd …

Member Avatar for microlifecc
1
293
Member Avatar for jo386

My code is rather basic so excuse my lack of shell scripting experience. I keep getting errors for line 3. I have tried changing "$1" to `echo $1` `cat $1` and even turning the whole line into a variable which i read in another forum and then calling that variable …

Member Avatar for jo386
0
1K
Member Avatar for mcogliandro

I have this script that I thougth only deleted stuff more than 90 days old but after I ran it, it deleted pretty much everything on my backup drive. Thankfuly I have another backup drive so I did not lose my backup but I need to fix this so it …

Member Avatar for rch1231
0
156
Member Avatar for Fredszky

Firstly, i'm really new to all this bash/unix/c stuff so i will probably get some words meanings wrong here, but anyway: Im trying to make a client pass simple shell commands to the server, which executes them. They communicate locally on the same machine through a socket. I can make …

Member Avatar for nmaillet
0
221
Member Avatar for Leela2403

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using %BASH% --login -i "/cygdrive/d/script.sh", where %BASH% is an environment variable in Windows set to C:\cygwin\bin\bash.exe. I have a created a Cygwin environment variable $EXE_PATH = /cygdrive/d/somepath/dir. Inside my script the line is …

0
170
Member Avatar for ms061210

Hi, I am creating a program that will validate if the user input date is correct. My problem is checking the month, 1. Is it possible to save the all the months in an array and then check the array if the user input is correct. 2. How can it …

Member Avatar for lewashby
0
204
Member Avatar for ziyaddinsadigov

Hi, I watched some shell scripting codes and I saw that there is a command, which name is LISTEN. What is the logic of this command and how I can use it?

Member Avatar for rch1231
0
164
Member Avatar for ziyaddinsadigov

I saw that github commands in linux terminal always uses word "git" before all it's commands. How to use my own word for my shell script? for example, $ git commit or $ git status

Member Avatar for L7Sqr
0
185
Member Avatar for ms061210

Hi. I want to create my date format but i dont know how. I want the user to input the date in format DD-MON-YY or else it will give him an error. How can I do that? any algorithm? ANy help would be appreciated. Thanks!

Member Avatar for Watael
0
88
Member Avatar for dharmendra1986

I have a .sh script which is as follows. #/bin/bash ssh uname@111.XXX.111.XXX | mysqldump -u uname -p test_db>/home/dm/Downloads/test.sql # script ended I want to extract the script from the server "111.XXX.111.XXX" and keep it in a server directory but I do not want to log in to the server. So, …

0
160
Member Avatar for dharmendra1986

I have a shell script like as follows #!/bin/bash # Downloading Dumps from the production server. Date=`date +'%d-%m-%y-%H-%M'` BACKDIR=/home/tmp/Backup #IP Address of the Server Host="localhost" #User Name USER="root" #Database Name DBS="test_db" echo "Backing up MySQL databases..." echo "Time: `date`" mysqldump -h $HOST -v --user=$USER --password=$PASS $DBS test_tbl1 test_tble2 ...... > …

0
129
Member Avatar for vishankparikh

Q-1 Write a shell script in Unix that lists files from your current working directory · By modification time when called with lm · By access time when called with la. By default, the script should show the listing of all the files in the current directory. Q-2 Write a …

Member Avatar for sbesch
0
143
Member Avatar for Borzoi

I am trying to write a shell script but I only want it to run if there are no files with a specific name found on the server. I know how to check for a specif file which would be done like this: if [ -f /path/to/file ] then echo …

Member Avatar for Watael
0
272
Member Avatar for saamsonn

#!/bin/csh echo -n "Enter a value> " set a = $< echo -n "Enter another value> " set b = $< echo "Doing mathematics> " @ r = $a + $b echo the sum a + b is $r tried runing this script and I keep getting this error report …

0
133
Member Avatar for dekker13

I've completed an assignment which takes a file with records, sorts them, and creates a table with the utility 'latex'. The interesting part is that my scripts runs perfectly on my Mac (Darwin) but it runs slowly with no response (or doesn't work depending on how you look at it) …

0
124
Member Avatar for muthu1802

Shel scrip to create automatic ROLLBACK statements for DDL's and put it into a separate file DDL's FILE Content ------------------ name:xyz ------------------------ --table 1 DROP table <tablename>; create table <tablename>;

0
121
Member Avatar for dineshkongonda

how we can use getch function in shell script to use scan code

0
78
Member Avatar for raistie_1

I have a shell script which mcrypts for me echo "Preparing..." mcrypt -F -c ./.mcrypt $ORIG echo "Moving..." mv "$ORIG.nc" $CRYPTED echo "Done" the php file calls it $COMMAND = './crypt.sh '.$CNAME; if ($_POST['cname']) { $output=shell_exec($COMMAND); echo $output; } i can see Preparing... Moving... Done but the file is not …

Member Avatar for DarkMonarch
0
123
Member Avatar for doomsday1216

I don't know if this is the right place for a post about Scheme, but i was wondering if anyone knew if there are loops and if statements in Scheme? (I am very new to Scheme, i know there are 'cond' statements, but i don't know if there are if's, …

Member Avatar for sepp2k
0
361

The End.