Sponsored Content
Full Discussion: Linux script - Crazy results
Top Forums Shell Programming and Scripting Linux script - Crazy results Post 302337650 by imprimisxo on Friday 24th of July 2009 02:43:24 PM
Old 07-24-2009
When I run it as BASH it gives different (but still undesired) results.

Code:
Code:
>cat exec_move_yesterday_files_from_incoming.sh
#
# Capture the current directory.
export -p CurrentDir="`pwd`"
echo $CurrentDir
#
# Capture the new directory name in the form YYYYMMDD.
export -p DateDir="`date +"%Y%m%d"`"
echo $DateDir
#
# Store the desired target directory.
export -p TargetDir="/staging/VCproc/TestIncoming"
echo $TargetDir
#
# Create the directory to move yesterday's file to.
cd $TargetDir
#mkdir $DateDir
`pwd`
#
#
cd $CurrentDir
`pwd`


Results:
Code:
VCproc@mpslx093[client]/staging/VCproc/application/dm
>bash exec_move_yesterday_files_from_incoming.sh
/staging/VCproc/application/dm
20090724
/staging/VCproc/TestIncoming
: No such file or directoryrom_incoming.sh: line 15: cd: /staging/VCproc/TestIncoming
: No such file or directoryrom_incoming.sh: line 17: /staging/VCproc/application/dm
: No such file or directoryrom_incoming.sh: line 20: cd: /staging/VCproc/application/dm
: No such file or directoryrom_incoming.sh: line 21: /staging/VCproc/application/dm

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Oh no!! crazy script

Hi Could be stupid, but I can figure out... I have a script that downloads a file from a http server ( virus definitions file ). The thing is that when I run it from the console (bash) works fine, but when I put it in the root's cron it doesn't, and it generates a core file. example: ... (8 Replies)
Discussion started by: piltrafa
8 Replies

2. Linux

How I will check wheather my linux benchmark results are OK

My system bench mark results INDEX VALUES TEST BASELINE RESULT INDEX Arithmetic Test (type = double) 2541.7 876123.7 344.7 Dhrystone 2 without register variables 22366.3 5411602.3 ... (1 Reply)
Discussion started by: chandra s
1 Replies

3. Linux Benchmarks

Results for Linux Benchmarks

Hi, I was trying to build Linux Benchmarks with latest Intel C++ Compiler. When I used -ipo (inter-procedural optimization) option, arithmetic test (arith.c) failed on execution. The problem is Intel compiler's advanced optimization option (-ipo) optimizes much more than expected and this... (50 Replies)
Discussion started by: cpjain
50 Replies

4. Shell Programming and Scripting

PERL cgi script... extra character driving me crazy

I'm using a PERL cgi script that uses rrdtool to make graphs. I can't get the syntax correct to use a degree sign (alt+0176 like this °) and also using a variable. If I use single quotes, I can't call the variable. If I use double quotes, there is an extra symbol (Â) before the ° which goes... (2 Replies)
Discussion started by: audiophile
2 Replies

5. Red Hat

Linux ls -L Results

I seem to be somewhat baffled by the results of the -L option of the ls command on our new Linux system. I have a symbolic link defined like the following: ptmawpmfld.sqr as /u21/xxxx/m/moranp1/yyyy/fixpaths/tests20091218/awpmfld.sqr When I issue the command ls -l ptmawpmfld.sqr, I see the... (2 Replies)
Discussion started by: ptmoran
2 Replies

6. Shell Programming and Scripting

Print some results in a text file using script in linux

hello everyone, i really need your help to write a script which would just print following kind of result into a text file (result.txt) XYZ test Results ID: <unique-id> Date: <date> ------------------------------------------------- | Task | Result | Time |... (3 Replies)
Discussion started by: viriimind
3 Replies

7. UNIX for Dummies Questions & Answers

UNIX/Linux/Distributions - driving me crazy...

Hello there, first of all: I do not want to become a hacker. you cannot do that. you cannot learn that from a book. Don't think I'm some kind of a script-kiddie. now that's settled let's start. I've been trying around with a lot of OS lately. I have backtrack5 installed on my notebook,... (10 Replies)
Discussion started by: Dr. Nick
10 Replies

8. UNIX for Dummies Questions & Answers

LINUX SORT command chops results

I am trying to sort a file . The file looks like this: DDFF 2 /ztpfrepos/pgr/load DDFQ 2 /ztpfrepos/pgr/load DDFX 2 /ztpfrepos/pgr/load DDUA 2 /ztpfrepos/pgr/load My command: sort -k1 /home/c153507/Bin/OPL1.txt -o /home/c153507/Bin/OPL1.txt The results are OK except for one line where... (4 Replies)
Discussion started by: Yahalom
4 Replies

9. Shell Programming and Scripting

How to Assign SQL Query Results to Variables in Linux?

Hi, I am new to linux... How to Assign SQL Query Results to Variables in Linux,i want ti generate it in param files, Can anyone please explain me. Ex: SQL> Select * from EMP; O/P: Emp_No Emp_Name 1 AAA 2 BBB 3 CCC and I want expected... (5 Replies)
Discussion started by: Sravana Kumar
5 Replies

10. Shell Programming and Scripting

Script to Run Multiple Systems Checks and mail me the results after every reboot- Linux

Hello, I'm trying to create a mechanism wherein a set of Production servers will email me the results of system checks like Uptime, NFS Mounts and a Process after every scheduled reboot. For this, I figured I'd use the @reboot parameter that crond comes with. I have added the below onliner... (3 Replies)
Discussion started by: pocodot
3 Replies
dhcpdb2conf(1M) 														   dhcpdb2conf(1M)

NAME
dhcpdb2conf - convert DHCP client database to config file parameters SYNOPSIS
index] [lan-interfaces] DESCRIPTION
The command translates a client system's DHCP database parameters (from into a set of standard configuration file parameters. This is an essential step for configuring a DHCP client system, and is invoked by upon every reboot when DHCP is active. A DHCP client database can contain settings for such items as: hostname, IP address, and default gateway (a subset of the "initial identity parameters" managed by and You can list the contents of the database to the screen, create a set of configuration staging files, or execute direct edits on existing configuration files using the values contained in the client database. Arguments: You can provide a list of lan-interfaces on which to operate, such as "lan0 lan1". If you specify no LAN interfaces, processes all entries referenced in the client's DHCP database. The entries are each defined as a unique LAN interface and a corresponding list of attributes. Options The following options determine the results of DHCP parameter processing. Print results to the screen (standard output). This is the default action if neither nor is specified. Apply directly: Using the results of the specified filters (see below), directly apply the parameter definitions to the existing configuration files, for example, to (This is how is called from Create copies: Create a set of staging files using the results of the selected filters (see below). Each parameter processed is applied to its corresponding copy of one configuration file [re]cre- ated by For example, is copied to (If the file already exists and can be written, it is overwritten; otherwise the command fails.) Once this staging file is created, the parameter being processed is applied to the newly created staging file rather than the real configuration file. The following "filter" options control which parameters are processed. The options can be combined in any manner. The default with no options is to process all attributes for each LAN interface. Hostname: Process the parameter. DNS: Process the parameter set (in Interface: Process the parameter set: Route: Process the parameter set: NIS: Process the parameter set: Time: Process the parameter. DHCP_SERVER: Prints the hostname of which has the given IP address for the interface. Options or have no effect. Option will print results only to the screen (standard output). Hostname: Do not update the parameter in configuration files. If the option is used with or then the option has no effect. Set array index for the set of related parameters for one LAN interface in the configuration files. For example, with (the default) the output would include The command can be run only by users with appropriate privileges. Configuration Files and Parameter Names The following files, and parameters in each file, can be processed by EXAMPLES List the entire contents of the DHCP client database: List only the parameter set for lan0: List the and parameter sets for lan0 and lan1: Apply the and parameter sets for lan0 to the existing configuration files: Apply all parameter sets to the existing configuration files using lan0, and set index = 1: WARNINGS
Using the option overrides any existing values which are currently set in the system's configuration files (while the option merely revises staging files, if any). FILES
The command itself. Current DHCP parameters received from a DHCP server by System configuration files that can be modified by SEE ALSO
auto_parms(1M), dhcpclient(1M), geocustoms(1M), set_parms(1M). dhcpdb2conf(1M)
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy