Sponsored Content
Top Forums Shell Programming and Scripting Bash script not parsing file with spaces in path Post 302906650 by Scrutinizer on Sunday 22nd of June 2014 02:28:58 PM
Old 06-22-2014
The script using #!/bin/sh whose test builtin probably does not know -nt (I presume /bin/sh points to dash). Try using #!/bin/bash instead..

Last edited by Scrutinizer; 06-22-2014 at 03:42 PM.. Reason: Incorrect
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Conversion of bash parsing script to perl?

I need help with a perl parsing script. I have some error logs on a windows machine that I need to parse from a text file, but I know nothing about perl. I usually run this bash script on my linux box and it does just what I need. How would I do the same thing with perl and port it to my windows... (2 Replies)
Discussion started by: cstovall
2 Replies

2. Shell Programming and Scripting

Bash Script to display directories in Path?

Hello there, As a newbie: The directories in PATH can be hard to distinguish when printed out as one line with colon .Please, can i have a sample script to display them,one to a line. Thank you. (1 Reply)
Discussion started by: debut
1 Replies

3. Shell Programming and Scripting

Importing a path/file into a bash script

Hey, I'm new here. Basically, I'm trying to make a bash script that affects a file of my choice. What I want to do is $./script.sh /path/to/file.jpg and then the bash script will know that variable=/path/to/file.jpg Thanks! (4 Replies)
Discussion started by: TFB
4 Replies

4. Shell Programming and Scripting

Help parsing filename with bash script

Hi all! Looking for some help parsing filenames in bash. I have a directory full of files named "livingroom-110111105637.avi". The format is always date and time (yymmddhhmmss). I'm looking to parse the filenames so they are a little more easily readable. Maybe rename them to... (4 Replies)
Discussion started by: mtehonica
4 Replies

5. Shell Programming and Scripting

parsing a config file using bash

Hi , I have a config _file that has 3 columns (Id Name Value ) with many rows . In my bash script i want to be able to parse the file and do a mapping of any Id value so if i have Id of say brand1 then i can use the name (server5X) and Value (CCCC) and so on ... Id Name ... (2 Replies)
Discussion started by: nano2
2 Replies

6. Shell Programming and Scripting

Looking for help with parsing file contents in bash [newbie]

Hi I'm just messing around with bash and trying to learn it because I have a course next semester dealing with OS design where we need to know how to use SSH client and either bash or ksh. I've never done shell scripting before. I just started today and I was wondering how parsing files... (1 Reply)
Discussion started by: mehungry
1 Replies

7. Shell Programming and Scripting

Column parsing in a bash script - HELP

I would like to setup a script that pulls in time/date in two seperate columns, and then name the other columns as listed below: Column1=Art/TJ output Column2=Art/TJ output Column3=TJ output column4=Art output Column5=If time/date past 12:00 noon -fail Colume6=If time/date before... (1 Reply)
Discussion started by: walnutpony123
1 Replies

8. UNIX for Dummies Questions & Answers

Getting path name using bash script

I have this code to extract the directory name ($0:h) in tcsh. I am converting the code to bash and need a way to get the equivalent setting for DefRaytracPath set DefRaytracPath = `echo $0:h | awk 'BEGIN {FS="/tcsh"} {print $1"/prog"}'` (3 Replies)
Discussion started by: kristinu
3 Replies

9. UNIX for Advanced & Expert Users

Parsing a file in bash

Hello All, I have the following input file that i'm trying to parse: 10.0.011.40 hadoop 15526 15524 0 hadoop 15528 15526 0 hadoop 19747 4018 1 10.0.081.227 hadoop 2862 2861 0 hadoop 2864 2862 0 hadoop 12177 14376 1 I'm trying to get this in my output file: 10.0.011.40 15526 15528... (2 Replies)
Discussion started by: ramky79
2 Replies

10. Shell Programming and Scripting

Parsing and Editing a json file with bash script

I am trying to automate editing of a json file using bash script. The file I initially receive is { "appMap": { "URL1": { "name": "a" }, "URL2": { "name": "b" }, "URL3": { "name": "c" }, } WHat I would like to do is replace... (5 Replies)
Discussion started by: Junaid Subhani
5 Replies
exit(1)                                                            User Commands                                                           exit(1)

NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps SYNOPSIS
sh exit [n] return [n] csh exit [ ( expr )] goto label ksh *exit [n] *return [n] DESCRIPTION
sh exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of the last command executed (an EOF will also cause the shell to exit.) return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe- cuted. csh exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the expression expr. The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to jump to a label that occurs between a while or for built-in command and its corresponding end. ksh exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit except for a shell which has the ignoreeof option (See set below) turned on. return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return is invoked while not in a function or a '.' script, then it is the same as an exit. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 exit(1)
All times are GMT -4. The time now is 05:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy