Sponsored Content
Top Forums Shell Programming and Scripting Bash script - $(ls expr) return double file name with one finishing with '.' Post 302718645 by pamu on Saturday 20th of October 2012 10:28:53 AM
Old 10-20-2012
You can remove one if ....Smilie

Code:
#!/bin/bash
SRCDIR=/root/.kde4/share/config
for MY_FILE in  $(ls $SRCDIR/kate*) ; do
    if [[ "$MY_FILE" == $SRCDIR/kate*. ]] ; then
            echo .
        else
            echo "Keep this : $MY_FILE"
        fi    
done

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help in finishing 2 commands

the first one: 1. i am trying to build a command that searches a text file and outputs the number of words which consists of two 'b' characters in each word separatly like barby (the b characters must be separated from one another) i tried to use grep filepath then i know that we need... (3 Replies)
Discussion started by: newby2
3 Replies

2. Shell Programming and Scripting

Return to HTML file from shell script

Hi! I'm writing a simple script which I call on using a simple html button. The script also recives a simple argument. After the script is done I immediately want to return to my html page. But I dont know how to do that! #!/bin/sh echo "Content-type: text/html" echo "" if then echo... (1 Reply)
Discussion started by: crille
1 Replies

3. Shell Programming and Scripting

How to enter a return key in bash script?

Hi, I'm porting an install script from AIX to Red Hat (2.6.18-164.el5 #1 SMP) I have this script working in both AIX and HP-UX. The script is a wrapper for a Micro Focus Server Express install program. It responds to the install program questions with a here-now list. Responses includes... (14 Replies)
Discussion started by: duker61
14 Replies

4. Shell Programming and Scripting

Script to return first x characters from file

I need a script to read the first 1000 characters of a text file regardless of how many lines it will span. So if my first line has 2000 characters i only want the first 1000 from this line, if my first and second lines have 500 character each then i want all the characters from both lines and... (5 Replies)
Discussion started by: kelseyh
5 Replies

5. Shell Programming and Scripting

Nested double quotes won't work in my bash script?

In a bash script I have: LSCMD="find /project/media/ -mindepth 2 -maxdepth 2 -name \"files*pkg\"" ALL_PACKAGES=$( $LSCMD | sort 2>/dev/null) But I get nothing returned. It's just all blank. If I run the find command in a terminal, I get dozens of hits. I figure it's the way how I'm... (3 Replies)
Discussion started by: superbbrr
3 Replies

6. Shell Programming and Scripting

Getting error in bash script; expr $a + 1: integer expression expected

Hi, I am new to shell/bash script. I am trying to run below script #!/bin/bash a=0 b=10 if then echo "a is equal to be" else echo "a is not equal to be" fi MAX=10 while do echo $a a='expr $a + 1' done (1 Reply)
Discussion started by: Mallikgm
1 Replies

7. Shell Programming and Scripting

Need help in finishing a bash script for listing subfolder by size in a large folder

Greetings everyone. I have seen that you do wonders here. I have a large folder on a Ubuntu linux. Organization main folder, inside 20 000 subfolders, and inside those subolders many other like 5-6 folders and files. I am interested to create an output to a txt file under the bash... (2 Replies)
Discussion started by: ultimo
2 Replies

8. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

9. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
AUTOSCAN(1)							   User Commands						       AUTOSCAN(1)

NAME
autoscan - Generate a preliminary configure.in SYNOPSIS
autoscan [OPTION]... [SRCDIR] DESCRIPTION
Examine source files in the directory tree rooted at SRCDIR, or the current directory if none is given. Search the source files for common portability problems, check for incompleteness of `configure.ac', and create a file `configure.scan' which is a preliminary `configure.ac' for that package. -h, --help print this help, then exit -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files Library directories: -B, --prepend-include=DIR prepend directory DIR to search path -I, --include=DIR append directory DIR to search path AUTHOR
Written by David J. MacKenzie and Akim Demaille. REPORTING BUGS
Report bugs to <bug-autoconf@gnu.org>. GNU Autoconf home page: <http://www.gnu.org/software/autoconf/>. General help using GNU software: <http://www.gnu.org/gethelp/>. COPYRIGHT
Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
autoconf(1), automake(1), autoreconf(1), autoupdate(1), autoheader(1), autoscan(1), config.guess(1), config.sub(1), ifnames(1), libtool(1). The full documentation for autoscan is maintained as a Texinfo manual. If the info and autoscan programs are properly installed at your site, the command info autoscan should give you access to the complete manual. GNU Autoconf 2.69 August 2017 AUTOSCAN(1)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy