Sponsored Content
Top Forums Shell Programming and Scripting Need a script to convert csh to bash Post 302539627 by vineet.dhingra on Monday 18th of July 2011 09:24:31 AM
Old 07-18-2011
can you tell me the key differences which are to be looked to convert it?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting bash script to csh

Hi, I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more... (4 Replies)
Discussion started by: Kweekwom
4 Replies

2. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

3. Shell Programming and Scripting

translate a short csh script to bash

Hi, I have a csh: set NODES = `cat $HOST_FILE` set NODELIST = $TMPDIR/namd2.nodelist echo group main >! $NODELIST foreach node ( $NODES ) echo host $node >> $NODELIST end @ NUMPROCS = 2 * $#NODES I am very frustrated to translate it to bash: NODES = `cat... (3 Replies)
Discussion started by: rockytodd
3 Replies

4. Shell Programming and Scripting

How to run a bash script in csh shell?

Hi how to execute a bash script in csh shell? Thanks (3 Replies)
Discussion started by: rubinovito
3 Replies

5. Shell Programming and Scripting

Convert .sh to .csh

Hi All, Could any one of you give me a hand to convert the following line of codes from .sh to .csh please ? proc_id=`fuser /tmp/test` if then echo "File is not being used by any thing" fi if then echo "File is being used... please wait" sleep 1 fi Regards. ---------- Post... (1 Reply)
Discussion started by: sraj142
1 Replies

6. Shell Programming and Scripting

how to convert from csh to sh

Dear all I am installing some eda software using script. My OS is ubuntu 10.04 and the eda software writing in csh. Since ubuntu reading script file in sh writting. I need someone can help me to convert some definition in script from csh to sh. Below is part of script set archinfo =... (3 Replies)
Discussion started by: tompham
3 Replies

7. Programming

Convert Bash script to C

dear all, i need your advice for convert bash shell to C programming INDEX=/zpool1/NFS/INDEX/${1} SCRIPT=/zpool1/NFS/script/${1} LIST=SAMPLE cd ${SCRIPT} for i in `cat ${LIST}` do GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'` /usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (2 Replies)
Discussion started by: zvtral
2 Replies

8. Shell Programming and Scripting

Is there any script to convert sh to csh ?

Hi All Is there anyone who have the script to covnert a sh sell script to csh and can share with me? Thanks a lot! Nick:b: (3 Replies)
Discussion started by: nicolast0604
3 Replies

9. Shell Programming and Scripting

Changing script from csh to bash

Hello Guys I have a script working fine on csh, but I would like to change it to bash, how I should change this command to be able to work as bash script. :wall: if ( $fsw > "0" ) then foreach swath ( `awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }'` ) ## work to be done... (2 Replies)
Discussion started by: jiam912
2 Replies

10. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies
PROP_INGEST(3)						   BSD Library Functions Manual 					    PROP_INGEST(3)

NAME
prop_ingest_context_alloc, prop_ingest_context_free, prop_ingest_context_error, prop_ingest_context_type, prop_ingest_context_key, prop_ingest_context_private, prop_dictionary_ingest -- Ingest a dictionary into an arbitrary binary format SYNOPSIS
#include <prop/proplib.h> prop_ingest_context_t prop_ingest_context_alloc(void *private); void prop_ingest_context_free(prop_ingest_context_t ctx); prop_ingest_error_t prop_ingest_context_error(prop_ingest_context_t ctx); prop_type_t prop_ingest_context_type(prop_ingest_context_t ctx); const char * prop_ingest_context_key(prop_ingest_context_t ctx); void * prop_ingest_context_private(prop_ingest_context_t ctx); bool prop_dictionary_ingest(prop_dictionary_t dict, const prop_ingest_table_entry rules[], prop_ingest_context_t ctx); typedef bool (*prop_ingest_handler_t)(prop_ingest_context_t, prop_object_t); DESCRIPTION
The prop_dictionary_ingest function provides a convenient way to convert a property list into an arbitrary binary format or to extract values from dictionaries in a way that is convenient to an application (for configuration files, for example). prop_dictionary_ingest is driven by a table of rules provided by the application. Each rule consists of three items: o A C string containing a key to be looked up in the dictionary. o The expected property type of the object associated with the key (or PROP_TYPE_UNKNOWN to specify that any type is allowed). o A callback function of type prop_ingest_handler_t that will perform the translation for the application. The table is constructed using a series of macros as follows: static const prop_ingest_table_entry ingest_rules[] = { PROP_INGEST("file-name", PROP_TYPE_STRING, ingest_filename), PROP_INGEST("count", PROP_TYPE_NUMBER, ingest_count), PROP_INGEST_OPTIONAL("required", PROP_TYPE_BOOL, ingest_required), PROP_INGEST_OPTIONAL("extra", PROP_TYPE_UNKNOWN, ingest_extra), PROP_INGEST_END }; The PROP_INGEST macro specifies that the key is required to be present in the dictionary. The PROP_INGEST_OPTIONAL macro specifies that the presence of the key in the dictionary is optional. The PROP_INGEST_END macro marks the end of the rules table. In each case, prop_dictionary_ingest looks up the rule's key in the dictionary. If an object is present in the dictionary at that key, its type is checked against the type specified in the rule. A type specification of PROP_TYPE_UNKNOWN allows the object to be of any type. If the object does not exist and the rule is not marked as optional, then an error is returned. Otherwise, the handler specified in the rule is invoked with the ingest context and the object (or NULL if the key does not exist in the dictionary). The handler should return false if the value of the object is invalid to indicate failure and true otherwise. The ingest context contains several pieces of information that are useful during the ingest process. The context also provides specific error information should the ingest fail. prop_ingest_context_alloc(void *private) Allocate an ingest context. The argument private may be used to pass application-specific context to the ingest handlers. Note that an ingest context can be re-used to perform multiple ingests. Returns NULL on failure. prop_ingest_context_free(prop_ingest_context_t ctx) Free an ingest context. prop_ingest_context_error(prop_ingest_context_t ctx) Returns the code indicating the error encountered during ingest. The following error codes are defined: PROP_INGEST_ERROR_NO_ERROR No error was encountered during ingest. PROP_INGEST_ERROR_NO_KEY A non-optional key was not found in the dictionary. PROP_INGEST_ERROR_WRONG_TYPE An object in the dictionary was not the same type specified in the rules. PROP_INGEST_ERROR_HANDLER_FAILED An object's handler returned false. prop_ingest_context_type(prop_ingest_context_t ctx) Returns the type of the last object visited during an ingest. When called by an ingest handler, it returns the type of the object currently being processed. prop_ingest_context_key(prop_ingest_context_t ctx) Returns the last dictionary key looked up during an ingest. When called by an ingest handler, it returns the dictionary key corre- sponding to the object currently being processed. prop_ingest_context_private(prop_ingest_context_t ctx) Returns the private data set when the context was allocated with prop_ingest_context_alloc(). SEE ALSO
prop_dictionary(3), proplib(3) HISTORY
The proplib property container object library first appeared in NetBSD 4.0. BSD
January 21, 2008 BSD
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy