unix find command
how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file name is not dontfile.txt ...
how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file name is not dontfile.txt ...
So, let's say that I have a command, foo, in a script which has both a return value, and an output string that I'm interested in, and I want to store those into a variable (well at least its output for the variable, and its return value could be used for a conditional). For example: a=$(`foo`) # this stores the output of "foo" if foo...
while executing a shell script in Unix Bash Shell, say any file in another folder and that is referenced by the script references some other file like ../../file_system_1/public/dir1/dir2/file2.xml script.sh --> references dir1/file1 as "./dir1/file1" dir1/file1 references another file as ../../file_system_1/public/dir1/dir2/file2.xml...
I have a batch file that I use to check whether my sites react to a ping. If a site doesn't react, the script writes the output into a text file. I wanted to use the same kind of script on a Linux system. Can anyone help me translating the code so that I can use it on a Linux shell? set list=domains.txt If "%list%" =="" GoTo EXIT for ...
I'm updating a bash script which serves as a program testing tool. Previously, I had this line in a script working perfectly ($BIN_FILE is set to a relative path to the binary being tested): $BIN_FILE $BIN_OPTS &> $LOG_FILE Then I've decided to add some "performance measurements": time $BIN_FILE $BIN_OPTS &> $LOG_FILE" This worked ...
Possible Duplicate: How do I get the application exit code from a Windows command line? Of course, if possible, without any VBScript-like scripts. ...
I have some video files all ending in .wmv .mov .mpg. I have music files ending in .mp3 .wma. And finally I have some text files all end in the extension .txt I wrote a shell script that generates subfolders, one for the music files, one for the video files, and one for the text files, and then organizes all of the files into the correc...
I used this command to find mp3 files and write their name on log.txt: find -name *.mp3 >> log.txt I want to move the files using the mv command and I would like to append that to the log file so it could show the path where the files have been moved. For example if the mp3 files are 1.mp3 and 2.mp3 then the log.txt should look lik...
#!/bin/sh #My script echo "Are you sure you want to reorganize your files?" echo "Type y or Y to continue. Anything else will stop the process" read response if [ "$response" = "y" ] || [ "$response" = "Y" ]; then mkdir video mkdir audio mkdir text mv -v *.txt text >> log.txt mv -v *.wmv video >> log.txt mv -v *.mov video >...
I wrote a bash script which tries to find a process and run the process if it had stopped. This is the script. #!/bin/bash process=thin path=/home/deepak/abc/ initiate=thin start -d process_id=`ps -ef | pgrep $process | wc -m` if [ "$process_id" -gt "0" ]; then echo "The process process is running!!" else cd $path $init...
In nodejs, the only way to execute external commands is via sys.exec(cmd). I'd like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a command and then push data to it (only to exec and receive its standard+error outputs), so it appears the only way I've got to do this right ...
Hello I've a text file with a line default_color acolor and I want to replace this line with default_color anothercolor I don't know the first color and the second is contained in a variable. How can I do it in bash ? Thank you ...
I have a file, one of whose line contains: number 8 how can i use sed, grep or whatever linux script to find out what integer is there in front of the line that starts with "number"? Thanks... ...
Hi I have to write a script to send mails thru unix shell scripts. The following script allows me to have variable message body. Is it possible to have a variable subject part in the bellow code?? #!/bin/bash # Sending mail to remote user sender="[email protected]" receiver="[email protected]" body="THIS IS THE BODY"...
Hi All, I am usig Fedora 10. if I write java -version in terminal, it gives me java version. I want to write a shell script file to check whether the java version is greater than 1.5. The main problem is that I donot know how to assign the value of java -version command as to a variable of shell script. How to create shell script file ...
i want to compare two number values in a shell script (sh) but it doesn`t work: #!/bin/sh let a=30 let b=100 let x=$a-$b echo $a $b $x [ $a < $b ] && { echo ok; } That outputs: 30 100 -70 ./x: line 6: 100: No such file or directory ...
The following shell scrip will check the disk space and change the variable "diskfull" to 1 if the usage is more than 10% The last echo always shows 0 I tried the global diskfull=1 in the if clause but it did not work. How do I change the variable to 1 if the disk consumed is more than 10% #!/bin/sh diskfull=0 ALERT=10 df -HP | grep -...
Hi, I'm using Coda for web developement. I often create new sites in my ~/Sites folder. I always enter the same information in Coda, except for the name of the site, and the directory where it's stored. Is it possible to create a plug-in (in either Cocoa or ShellScript) which automates this (so I don't need to enter all FTP stuff etc......
i have command ccv this will output as below Your Project : gdgdd750V64OG , Building Block : cgd9gdd . if i do ccv | awk '{ print $9}' cgd9gdd now i am tring to create a log file by running a build process & tee log_`date +%Y%m%d%H%M%S`_`ccv | awk '{ print $9}'` but this is not creating the log corrrectly. ins...
He is a nice guy. "Rob" doesn't like it though. How to extract Rob from this line using shell script? ...