shell programming
Tag details
Welcome to the 'shell programming' tag page at Technorati. This page features content from the farthest reaches of the Blogosphere that authors have "tagged" with 'shell programming'.
Latest blogosphere posts tagged “shell programming”
-
file processing
The UNIX and Linux Forums —
Authority: 167
Hello, I am trying to find a solution which could be simple rather than coding unnecessary code. Scenario I have is :- I have a line sequential text file and while reading the file I need to call some kind of program which does data transfer, and read next so on... The issue I have is I have to process 5 lines at a ...2 hours ago -
bash string replace
The UNIX and Linux Forums —
Authority: 167
Bash shell. Im trying to filter a string taken from user input. I can replace one word at a time. This method supports regex, so is it possible to replace various words at a time? Code: STRING="Hello World! word1 word2"; FILTERED=${STRING/word1|word2/}; # Not working: replace 2 or more words ??? echo $FILTERED;4 hours ago -
Need assistance with simple shell script to organize files. [Code attached]
The UNIX and Linux Forums —
Authority: 167
I need some help with this shell script for class. All it does is organize your files. It works, but in the log file, it needs to show the new filepaths of the moved files. Heres my log of my output: Code: Starting to organize... movie2.wmv --> movie3.mov --> movie1.mpg --> song1.mp3 --> ...6 hours ago -
How to replace some content of a file and write with a new name
The UNIX and Linux Forums —
Authority: 167
Hi I have a control file which looks like this LOAD DATA INFILE /home/scott/XXX.dat PRESERVE BLANKS ............. ............. how can i change the content of this file and replace the file in the second line with anothe file name and write it back with another name to the disk? Thanks6 hours ago -
execute sql query unix unix script
The UNIX and Linux Forums —
Authority: 167
Hi I am new in unix. oracle and unix are installed in my sytem.i need the script which could connect to the oracle using username ,password and schema and can run the select * from tab query. Thanks vijay9 hours ago -
Execute SQL query in unix script
The UNIX and Linux Forums —
Authority: 167
Hi I am new in unix. oracle and unix are installed in my sytem.i need the script which could connect to the oracle using username ,password and schema and can run the select * from tab query. Thanks vijay9 hours ago -
who deleted crontab
The UNIX and Linux Forums —
Authority: 167
We are using SunOS 5.10 and Korn Shell. If we need to figure out who deleted our crontab file for a particular user what do we do. Thanks in Advance!! ---------- Post updated at 08:08 AM ---------- Previous update was at 07:19 AM ---------- Friends, Please help....9 hours ago -
Read CSV column value based on column name
The UNIX and Linux Forums —
Authority: 167
Hi All, I am newbie to Unix I ve got assignment to work in unix can you please help me in this regard There is a sample CSV file "Username", "Password" "John1", "Scot1" "John2", "Scot2" "John3", "Scot3" "John4", "Scot4" If i give the column name as Password and row number as 4 the result I should get Scot3 can ...13 hours ago -
want to zip the all files till nth depth
The UNIX and Linux Forums —
Authority: 167
All, i need a script which can zip the all files which are in directories and its subdirectories for example: dir1 contains file1,file2,dir1a,dir1b now dir1a also contains fil11,fil12 ,dirab so script should look for files in dir or sub dir till files not found and zip the all files.17 hours ago -
Parsing Comma separated Arguments
The UNIX and Linux Forums —
Authority: 167
Hi unix gurus I want to execute a shell script like ksh printdetails.ksh Andy,Bob,Daisy,Johnson like passing all the four names in the as the arguments and these arguments are varies between 1 to 10. How to pass these names to the shell script variable. and also i want to know the count of arguments passed to ...17 hours ago -
Parsing Comma seperated Arguments
The UNIX and Linux Forums —
Authority: 167
Hi unix gurus I want to execute a shell script like ksh printdetails.ksh Andy,Bob,Daisy,Johnson like passing all the four names in the as the arguments and these arguments are varies between 1 to 10. How to pass these names to the shell script variable. and also i want to know the count of arguments passed to ...17 hours ago -
csplit suffix-format: how to?
The UNIX and Linux Forums —
Authority: 167
I am using GNU csplit to extract chapters from a big file into smaller files. I want to use the -b option -b, --suffix-format=FORMAT use sprintf FORMAT instead of %d but I have failed so far. 1) All the generated files need to have a suffix .txt at the end 2) They have to look like something ...21 hours ago -
bash script (using find and grep)
The UNIX and Linux Forums —
Authority: 167
Im trying to make a simple search script but cannot get it right. The script should search for keywords inside files. Then return the file paths in a variable. (Each file path separated with \n). Code: #!/bin/bash SEARCHQUERY="searchword1 searchword2 searchword3"; for WORD in $SEARCHQUERY do ...1 day ago -
Delete the files older than 3 weeks in a particular directory.
The UNIX and Linux Forums —
Authority: 167
Hi, Friends, I am writing a script to delete all the files which are there for more than 3 weeks. I have tried this : find /home/appl/backup -type f -mtime +21 -exec rm -f {} \; But i am not sure if it deletes only the files in specified directory or all the directorinies in the provieded to it. I tried ...1 day ago -
using awk to create files based on a variable name
The UNIX and Linux Forums —
Authority: 167
Hey all, I am parsing a file which have records containing one of a number of files names: ".psd", ".cr2", ".crw" , ".cr", ".xi", ".jpg", ".xif" etc Somewhere on each line there is a value "Namex.psd" "Namex.crw" etc. The position of this name is highly variable I need to output all the ".psd" records into a single ...1 day ago -
Matching white space through Grep
The UNIX and Linux Forums —
Authority: 167
Hello All, I am trying to match white space in patterns through - Grep I tried [[:space:]] & [[:blank:]] but none of them worked. Then I tried Perl extension \s and it worked. So just wanted to know if [[:space:]] & [[:blank:]] are still supported or have they become deprecated. However they have been ...1 day ago -
Preserve first line and search in others
The UNIX and Linux Forums —
Authority: 167
Hi gurus Is possible to preserve first line of text and search in another lines ? the only way that I think is: Code: ps aux | awk {if (NR==1) {print $0} else if ($11 ~ /sshd/) {print $0}} but is there any more elegant way ? thanks1 day ago -
Awk Assistance
The UNIX and Linux Forums —
Authority: 167
Hello A friend of mine posted this on another site that I follow. It is to advanced for me to figure out. If solved I will give credit where credit is due: NOTE: Does not have to be AWK. Any Language will work, Hi. I need a little assistant to write an awk script on linux that reads a file that looks something ...1 day ago -
extracting field from array
The UNIX and Linux Forums —
Authority: 167
I have a problem with the following lines of code: Code: SaveIFS=$IFS IFS="/" declare -a Array=($1)#take unix path, split by / website=${Array[4]} #stores website name The confusing part is that it works on one machine, but not on the other. If the code is moved ...1 day ago -
checking the file in remote server using SFTP
The UNIX and Linux Forums —
Authority: 167
Hello, I would appreciate if any one can help me on this. The below script start running at 12:30AM. Every 5 min, i go and check the remote site. If i see filewatch.txt over there, then i need to call another shell script and load the data into database. If i dont see that file, then i have to loop for one hour(sleep ...1 day ago