You could use a case statement to match the "busybox" string:
Thank you a lot for the support
Using case in: again, no advantage over grep, as both are external commands to the shell. Using Grep permits me to continue with the if/else structure
Any other way to replace this part of code:
By the way, I tried also this one:
But it ends detecting all symlinks as related to busybox, even those that are not related to it. Any reason you see for that?
Should I try
?
Quote:
Think you are going to have to resort to rebuilding the tar with your new/replaced files:
Extract existing tar archive into a temp area
copy additional/replacement files into same structure
retar the whole thing
delete the temp area.
---------- Post updated at 09:54 AM ---------- Previous update was at 09:48 AM ----------
Don't think ${f:1} is supported under ash you man need to use ${f#?} instead.
Did not think at it that way, good idea :-)
Edit:
${f:1} worked fine under /bin/sh (android) and also with the busybox ash I use actually. But thank you for the other alternative
Hi All,
During my virtual machine power on i have rc3.d script to accept user inputs like IP address. This script gets executed during first time boot up. It was working fine till my VM is using RHEL6.5. Now we migrated to RHEL 7 environment. While accepting the user inputs in console, I... (4 Replies)
Is there any error while executing this script..
#!/bin/bash
FINDPATH=/home/ftpcdr/cdr/192.168.3.91
BACKPATH=/home/ftpcdr/backup
STATUS=$?
cd $FINDPATH
find -type d -mtime +30 -print > $BACKPATH/list.txt # FIND FILES THAT CREATED BEFORE 30 DAYS.
FIRST=$(ls $BACKPATH/list.txt | grep... (5 Replies)
So i have read the man pages a few time. Searched google but I am not quite sure i understand all the lingo.
What i want to do is list all files on / except i dont want any symlinks (because if I am searching / I will find the "true" file...correct?)
So there is the -P, -H, and '-type l'... (2 Replies)
Hello
I have a production mysql server and archive server, unfortunitly its not possible to setup repliacation between the two, the reason is that the archive server is using some fancy storage engine which doesn't allow mysql replication.
I'm trying to write a script using perl that does... (1 Reply)
Hi Everyone,
we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment?
Thanks in adv. (0 Replies)
you are to write scripts for a customer that would require a system enable the backing up of files and directories. The script should (these names should be used):
1. INITIALISE: Initialise the directory for the backup(called backup and should be in the home directory) and any other... (1 Reply)
Ive got multiple PCs, sharing an NFS mounted home dir. For certain apps I would like to keep the config files host specific. Easy solution is to create symlinks to local folders for configs. Ideally I would still want the .config files to reside in the user home folder.
Is it possible to... (2 Replies)
Please don't laugh or call me a fool...
I'm trying to set up a script that will go through my Music File directory and generate a set of symbolic links in a directory called "What's New". Within that directory there will be a "30 Days", "3 Months", "6 Months" and "A Year" directories. Within... (0 Replies)
Hello All,
Assuming i have a thousand symlinks under directory /mydir (and its sub-dir) such as:
mysymlink1 -> ../../../myfoo/mysymlink1
mysymlink2 -> ../../../myfoo/mysymlink2
How can I search the string "myfoo" and replaced with "yourfoo" such that after the operation is complete the... (2 Replies)