Sponsored Content
Full Discussion: Bash scripts as commands
Top Forums Shell Programming and Scripting Bash scripts as commands Post 302640649 by Leo_Boon on Tuesday 15th of May 2012 07:36:48 AM
Old 05-15-2012
Bash scripts as commands

Hello,
the bulk of my work is run by scripts. An example is as such:
Code:
#!/bin/bash

awk '{print first line}' Input.in > Intermediate.ter
awk '{print second line}' Input.in > Intermediate_2.ter
command Intermediate.ter Intermediate_2.ter > Output.out

It works the way I want it to, but it's not very flexible. If I want to change the input, I need to manually open the script and rewrite a different file in the appropriate place. Is there a way to word it so that it would work like this:
Code:
#!/bin/bash

awk '{print first line}' VARIABLE > Intermediate.ter
awk '{print second line}' VARIABLE > Intermediate_2.ter
command Intermediate.ter Intermediate_2.ter > Output.out

and
Code:
./Script Input.in

IE, it reads the first file after the script and uses that to substitute in VARIABLE? What about with multiple variables at the same time?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running shell scripts automatically without using Batch or at commands

I have been trying to run a unix script which contains many sql statements.I need to run this script every monday morning. I tried to run on command prompt, it works fine. But while I run it via batch or at command., it returns with library module could not be loaded (libcompat.1.o could not be... (3 Replies)
Discussion started by: ritzwan0
3 Replies

2. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

3. Shell Programming and Scripting

writing shell scripts of commands

can anyone help me in writing a shell script to visualize how simple commands work and on what logic. For Eg: ls command how it lists out all the files and directories, need to write a simple script based on the commands source code.:D (0 Replies)
Discussion started by: rahul_11d
0 Replies

4. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

5. Homework & Coursework Questions

1st yr Exam revision thread - Scripts, C, Commands

Hello, I have an exam for 1st year Linux and Unix programming coming up in a week and I need some help going over the past exams, I want to make sure I'm getting the right answers in the past exams to ensure full marks. The internet is a distraction so making this thread will hopefully help me... (3 Replies)
Discussion started by: murphy
3 Replies

6. Homework & Coursework Questions

Calculating Total and Averages with awk Commands & Scripts

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write an awk script(company.awk) for the workers file to find the number of workers of each departman, total... (8 Replies)
Discussion started by: RedJohn
8 Replies

7. Shell Programming and Scripting

How to run several bash commands put in bash command line?

How to run several bash commands put in bash command line without needing and requiring a script file. Because I'm actually a windows guy and new here so for illustration is sort of : $ bash "echo ${PATH} & echo have a nice day!" will do output, for example:... (4 Replies)
Discussion started by: abdulbadii
4 Replies

8. UNIX for Beginners Questions & Answers

UNIX commands and scripts

Hi guys, Hoping someone can help with the below - involves basic commands and some scripting. Thanks so much in advance for your amazing time and help. 3. The file /etc/profile contains the default initialization options for your shell. Produce a unique list of all variables with uppercase... (1 Reply)
Discussion started by: edujs7
1 Replies

9. UNIX for Beginners Questions & Answers

Saltstack commands inside bash scripts donā€™t work

In a Redhat Linux environment, I could run salt commands on the $ prompt but not inside my bash scripts. It will say command not found and the $PATH variable is exactly the same outside and inside the script. !#/usr/bin/bash echo “running”¯ salt "*" cmd.run ‘ls' exit Output:-... (8 Replies)
Discussion started by: gurudewa
8 Replies
Net::LDAP::Intermediate::SyncInfo(3)			User Contributed Perl Documentation		      Net::LDAP::Intermediate::SyncInfo(3)

NAME
Net::LDAP::Intermediate::SyncInfo - LDAPv3 Sync Info Message object SYNOPSIS
See Net::LDAP::Control::SyncRequest DESCRIPTION
"Net::LDAP::Intermediate::SyncInfo" provides an interface for the creation and manipulation of objects that represent the "Sync Info Message" as described by RFC 4533. CONSTRUCTOR ARGUMENTS
In addition to the constructor arguments described in Net::LDAP::Intermediate the following are provided. TODO METHODS
As with Net::LDAP::Intermediate each constructor argument described above is also available as a method on the object which will return the current value for the attribute if called without an argument, and set a new value for the attribute if called with an argument. SEE ALSO
Net::LDAP, Net::LDAP::Intermediate, Net::LDAP::Control, Net::LDAP::Control::SyncRequest, Net::LDAP::Control::SyncState, http://www.ietf.org/rfc/rfc4533.txt AUTHOR
Mathieu Parent <math.parent@gmail.com> Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org> COPYRIGHT
Copyright (c) 2008 Mathieu Parent. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-07-21 Net::LDAP::Intermediate::SyncInfo(3)
All times are GMT -4. The time now is 03:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy