General :: How To Write Korn Shell
Oct 14, 2010I am new and start learning how to write korn shell, can you someone please translate the below command to common English? code...
View 1 RepliesI am new and start learning how to write korn shell, can you someone please translate the below command to common English? code...
View 1 RepliesIve been playing around with Linux a little bit and have started to look into different shell types. I know BASH is the most basic, or that is in most distro. but is there any disadvantages of using a Korn shell instead?
View 7 Replies View RelatedSomehow I'm not really managing this thing, which would d be a nice way to useariables.What I am doing is setting up compound variable in ksh. What I have is a "config" file, which has fields delimited by a semicolon
Code:
cat ${CONFIGFILE} | grep -v "^#" | grep -v "^$" | while read line
do
[code]...
I work for AT&T and our Windows-centric workgroup is being tasked with supporting an app running on RedHat. To help my coworkers, I'm building a Fedora 11 VM that we can play with to familiarize ourselves with the UNIX environment.
Because of corporate network policies in place, my VM can't get access to the Internet.
Since we're AT&T employees, we're naturally using the korn shell on the production system. I'd like to install the korn shell on my VM. However, it doesn't appear to be part of the base fedora repository.
Is the korn shell available for Fedora? If so, how would I copy it to shiny media, mount it on my VM, and install it?
Some may recall I recently gave up on bash, rather than give up my programming style.Surely I will have reason to return but that's another story. My little issue now:I am debugging a new [Korn] shell script. I have a function that performs a specialized match on a string and I see that I am able to call that function with no problem, with both of it parameters. The function does not do any print or echo command - it uses "return" for a TRUE (0) of FALSE (1), as is the shell exit code convention. Thus, I have the following test:
Code:
if [[ match_except_release ${PATH_DIR[$LC]} bin ]]
then
[code]....
I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.
View 8 Replies View RelatedI would like know when it is necessary or advisable to write a shell script instead of shell function ?
View 3 Replies View Relatedhow to write own shell in linux?i want to know procedure of shell programming.
View 5 Replies View Relatedwrite a shell script that allows only user 1 and user 2 to execute a program and only from terminal 01 and terminal 02
View 4 Replies View RelatedI want to write a shell script contains python one. So,the result of python one is flv file. I want the path of this is copied into a enviroment variable that i have to pass as a flag argument of another program (to convert into mp3). To individuate the result of python script I thought to use (in PWD)
Code:
ls | grep -E '^.*mp3$'
But my question is: How can I copy this result into enviroment variable?
I do not know how to write either PYTHON or Bash Shell Scripting. I am to learn one for Linux Administration purpose. Which one will you recommend for a Linux Admin/Eng environment?
View 4 Replies View Relatedi have to write a shell script that will delete all the .dat files in /var/oracle/etl/incoming which the created date of the file is 7 days before the currrent date.
View 8 Replies View Relatedi was trying to figure out a way to write my own linux commands.. in fact i wanted to write a shell script to simulate an already existed linux commands like 'cd','ls' and'adduser'i just dont know the language of scriptting and even doesnt know the steps to make a script
View 3 Replies View RelatedI want to write expdp output in a text file using a shell script
If i write like below:
It will write whatever is there in log file to text file
But, sometimes export fails with out start taking export (without generating log file) because of job already exists error. such times, we dont know about that error until we check manually... so i wrote like below:
But still it is not writing anything in to text file using above stmt...
We have zabbix Network monitoring tool installed on two servers 172.17.11.6 ( Master ) and 172.17.11.3 ( Slave ) RHEL 5.4 Servers with 172.17.11.4 being Virtual Ipaddress.We are trying to implement High Availability with Red Hat Cluster Suite.OS level Clustering has been implemented with following cluster configuraiton.
But we need to implement Application level clustering for Zabbix_server process which inturn depends on httpd and mysqld deamons to be running.So I have to check the health of mysqld and httpd with a shell script along with the health of zabbix_server process.Any good tutorials for this ? Any guidlines that I have to follow ?Here I may need to take care of following things when any one of the process goes down
1. Shifhting Virtual IP
2. Shifting /dev/sdb1 ( Shared drive to slave )
3. stopping other services on master
4. starting all the services on slave
I have two linux servers, they are backup together.
1. Server 1 have 3 files with name: file1, file2, file3 in the path: /etc/sysconfig/network-script/.
2. Server 2 have 3 files with name and path are the same as server 1.
- How to make a script to copy 3 files at server1 to overwrite on server2. But before overwrite, this script will check and compare the last modified date of these 3 files(on server1 and server2). if the modified date of file1, file2 or file3 on server1 is newer than 3 files on server2 then overwrite process will do, if not, will do nothing.
- see my script as below: it works find now but just overwrite. not check last modified date.
i want to write shell script that give a number between 1-3444 from user and if user enter out of range number give error e.g number must between
read -p "plz Enter Number " p
while [ $p != [1-9] -o $p != [1-9][0-9] -o $p != [1-3][0-4][0-4][0-4] ]
do
read -p "plz Enter Valid Number" p
done
but this have an error in while statement ! two many argument
I am new to writing shell scripts. So, please bare with me. I am currently trying to write a shell script which will read the directory path as input from user and will traverse the Dir tree to find all available audio and video files. I have tried to write as much as I could but I don't know where I am making mistake as I get some files to be audio file which are actully tar balls. On the second note there are some files which video but script shows them to be audio. And, some video files are completely skipped. I am giving the shell script below so that you can see. I am using two external files as source which I am attaching.
Code:
#!/bin/bash
#Let's load the extensions that we want to search for
vdExt=$(cat vdExtList)
adExt=$(cat adExtList)
[code]....
I'd like to know some good resources, links, e-books to learn basic Linux system administration scripting. I know how to write very basic BASH shell scripts so I'm still at beginner level. There are so many docs out there that I'd like to narrow down people's opinion's on the best easy to understand resources that are available. Eventually I'd like to learn basic PERL as well.
View 3 Replies View RelatedHow can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.
View 2 Replies View RelatedI need to write shell script which can take number of files and count total rows from all CSVs and display total number of rows counted in all files. Is there any possibility of doing that using shell script and if yes then how.
View 4 Replies View RelatedI need to write a shell script which can ready content of the folder and place files on remote FTP server. I need to make sure that a file that is already placed on remote FTP server is not attempted second time. The file names will be something like Records-2011-05-09. The files will be generated by MySQL every hour.
View 7 Replies View RelatedI've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?
View 1 Replies View RelatedI'm trying to write a toy linux shell. For starters this is what I'm trying to do:
1. Start a new process with fork.
2. Execute a program in the new process with execl().
3. Redirect the output from the new process from STDOUT to another file descriptor, using dup2(2).
4. In the parent process, read the output from the child process and write it to the screen.
Creating a new process and executing a program in it is no problems, the problem is that I can't seem to capture the output from it in the parent process.
Code:
//digenv
//C++arl 2011-03-24
#include <stdio.h>
#include <sys/types.h>
[code]...
I wish to create my own shell for my operating systems project in college...
My professor has asked me to make sure that my shell can execute at least 30 or 40 commands... I have around a month's time
I have seen endless source codes in the net, I'm not able to understand any of it
How do i get about doing it?
I have a number of text files throughout my /home/pjs/Documents directory tree that have execute permissions set. Almost all of my file names have spaces in them. I am trying to write a shell script that will look at each file in my Documents directory, find the ones that have execute permissions set, and run the command chmod 644. Of course, I don't want the command run on the directories.
The following script *doesn't work*, but might serve to illustrate what I am trying to do:
#!/bin/bash
for x in "$(ls -R)" do
if [ -f "$x" ] && [ -x $x ]; then
chmod 644 "$x"
fi
done
I want each file and directory name to be placed, one by one, in the variable $x, and then tested with the "if" conditionals.
The first problem seems to be that, although the command "ls -R" does produce a complete list of the files and directories I need, they are not placed, one by one, in the variable x like I want them to be.
Also, I think I should use the shift command so that the option -R doesn't get included as one of the values of the variable $x, but I can't figure out where to put it.
I write a shell script below to add a job to cron.
#!/bin/sh
touch date.cron
echo '*/3 * * * * /usr/sbin/ntpdate 192.168.2.3' >date.cron
[code]....
I need a help regarding writing a function in a shell, what exactly a function does!!
View 3 Replies View Relatedunable to write a shell script to vi
View 1 Replies View RelatedI have a question, tried to search on the Internet but it is hopeless. I want to write a shell script(bashShell) that will run commands of configuration for vim editor.For example: in the script, it will run ":let", ":set", ":highlight" to configure for vim editor. In addition to, when I searched a pattern and wrote it to file,ed vi to open it automatically. But, I couldn't highlight a word(that is the pattern I'm searching) in vim automatically
View 3 Replies View Related