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'.

Look up Offsite Link "shell", Offsite Link "programming" at The Free Dictionary

Latest blogosphere posts tagged “shell programming”

  • How to compare that file name is empty?


    The UNIX and Linux ForumsAuthority Authority: 172
    i am finding some pattern this way.. fname=`grep -w "^$index" $HOME/UnixCw/backup/Path.txt` how to check that fname is empty i.e. if pattren doesnt found then i want to do other operations....
    8 hours ago
  • Understanding a Simple Shell Script


    The UNIX and Linux ForumsAuthority Authority: 172
    Code: #! /usr/bin/ksh old=$1 new=$2 for file in *.$old ; do     mv $file ${file%$old}$new done exit 0 This script i got from the forum. script changes the extension of the files say example a.txt to a.doc b.txt to b.doc c.txt to c.doc d.txt to d.doc this scipt works fine but i am not getting the concept ...
    9 hours ago
  • restoring file to its default location...


    The UNIX and Linux ForumsAuthority Authority: 172
    Hello everyone, I am new to unix shell. I have a file called Path.txt....and i have data in that as 1 abhi 2 avi 3 ash so on..... 1 ,2 ,3 is the index..... my concern is ...
    11 hours ago
  • PHP: Search Multi-Dimensional(nested) array and export values of currenly worked on array.


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi All, Im writing a nagios check that will see if our ldap servers are in sync... I got the status data into a nested array, I would like to search key [3] of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable so...eg...let take the single array below.. [1] ...
    11 hours ago
  • File Operation


    The UNIX and Linux ForumsAuthority Authority: 172
    I have one text file like 1 filename 2 filename2 3 hi 4 myname i have one variable in which i have index value..i.e.1,2,3 and so... i want to copy value after the index into somevariable..... how i can do it....
    12 hours ago
  • sed with variables


    The UNIX and Linux ForumsAuthority Authority: 172
    Dear All, Ive a question regarding sed . is it possible to process avariable instead of file like this sed s/// Thanks, Mohammed:)
    13 hours ago
  • Simple HTTP server in GAWK


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi, Not sure if this post belongs to this forum but I have been trying every so often to setup a simple http server in awk. After a couple of try and errors I finally came across this: REMCONF - TCP/IP Internetworking With `gawk This tutorial is not to cut and paste without change, so here is a complete gawk ...
    13 hours ago
  • [PHP] Setting a Superglobal from the Shell ?


    The UNIX and Linux ForumsAuthority Authority: 172
    Hey, Does anyone know if it is possible to set a PHP Superglobal variable (in an Apache2 working environment) from the shell or command line? I tried to set one like this by creating a file env.php with this: PHP Code: $_ENV [ MYCOOLVAR ]  =  YEAME ; ?> And I executed as ...
    14 hours ago
  • Cron job for every five minutes and between hours


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi I need to run a script every five minutes and it should run between 07-15 hours all days. How i can achieve this... i tried like this Code: */5 07-15 * * * /scripts/CreateFtpData.sh It throws an error... Quote: crontab: error on previous line; unexpected character found in line.
    16 hours ago
  • awk command not working from the shell script


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi, When i run the below command i am able to get the output. Code: awk /BEGIN DSSUBRECORD/{c=3;next}c-->0 abc.txt | awk /END DSSUBRECORD/{exit}{print} | awk /Owner/{exit}{print} | awk {n2=n1;n1=n;n=$0;if(NR%3==0){printf"%s,%s,%s\n",n2,n1,n}} Output: Code: Name "file_name",          Prompt ...
    18 hours ago
  • awk command not working from the sheel scirpt


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi, When i run the below command i am able to get the output. awk /BEGIN DSSUBRECORD/{c=3;next}c-->0 abc.txt | awk /END DSSUBRECORD/{exit}{print} |awk /Owner/{exit}{print} | awk {n2=n1;n1=n;n=$0;if(NR%3==0){printf"%s,%s,%s\n",n2,n1,n}} Output: Name "file_name", Prompt "Enter the file name", ...
    18 hours ago
  • awk command not working from the shell scirpt


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi, When i run the below command i am able to get the output. Code: awk /BEGIN DSSUBRECORD/{c=3;next}c-->0 abc.txt | awk /END DSSUBRECORD/{exit}{print} | awk /Owner/{exit}{print} | awk {n2=n1;n1=n;n=$0;if(NR%3==0){printf"%s,%s,%s\n",n2,n1,n}} Output: Code: Name "file_name",          Prompt ...
    18 hours ago
  • awk networking through sockets


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi, I have been trying every now and then to get awk communicate trough sockets. What I have found so far: Network Administration with AWK TCP/IP Internetworking With `gawk How can I implement these tutorials on my Debian box? When I try the first example of the first link, I am greeted by a: Quote: ...
    18 hours ago
  • Grep from file


    The UNIX and Linux ForumsAuthority Authority: 172
    Dear All I had below mention requirement. Kindly sugguest me possible ways. Thanks Regards Jaydeep IN PUT FILE: CELL BROADCAST SHORT MESSAGE SERVICE MESSAGE DATA ID CODE GS UPDATE MODE LANG MCO MCL NUMPAGES 50 1000 0 13 MML 1 1 TEXT ...
    21 hours ago
  • How do I do this: -$: sample.sh


    The UNIX and Linux ForumsAuthority Authority: 172
    I apologize for the confusing title .. What I want to do is write a script that pulls specific input from the command line (after the script name) rather than from within the script. Example: Code: -$: howfarbetween.sh Montreal Chicago Where the script would run based on the inputs of the two city names. ...
    1 day ago
  • Help with Compare and search content in directory


    The UNIX and Linux ForumsAuthority Authority: 172
    Hello, How to search in directory by comparing some string with the content of directory. Ex: I want to compare abhi string with the content of backup directory. i.e want to check that is there any file in backup directory having name as abhi
    1 day ago
  • Search for word in a xml file and replace it with something else


    The UNIX and Linux ForumsAuthority Authority: 172
    Hello Unix Users, I am very new to Unix so I am not sure how do I do the following. I need a script such that when I type the following in the command prompt > . scriptName.sh wordToBeReplaced DirectoryLocation will find the word someword located in a somefile.xml in DirectoryLocation directory and ...
    1 day ago
  • PHP: how can I delete empty/NULL elements from a multi-dimensional array.


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi all I have a file that im running and exec(cat ./dat) against..and putting its contents into any array, then doing an exploding the array into a multi-dimension array... The 15 multi-dimensional arrays have elements that are null/empty, I would like to remove/unset these elements and then re-order the index/keys. ...
    1 day ago
  • File deliminated with | character - How do I change 1 value


    The UNIX and Linux ForumsAuthority Authority: 172
    Hi All, Im struggling with a problem. Data file example: Brown|32 inches|apple|monkey Green|12 feet|grape|cat Blue|32 inches|banana|dog Black|23 inches|pear|horse I need to change the value 32 inches in the third line, and only the third line, while keeping the rest of the file the same. I can isolate the ...
    1 day ago
  • help with UNIX script


    The UNIX and Linux ForumsAuthority Authority: 172
    I am currently a student enrolled in a UNIX class and am in need of help for a project. I have to write a script that will run the grep command on a particular word or pattern in a specific file defined by the end user. however, I have got stuck. What I have so far is: clear loop=y while [ "$loop" = y ] do tput ...
    1 day ago

Comments about shell programming

Personal attacks are NOT allowed
Please read our comment policy